[LON-CAPA-cvs] cvs: loncom / lontrans.pm /auth lonacc.pm lonwebdavauth.pm
raeburn
raeburn at source.lon-capa.org
Tue Aug 16 16:17:54 EDT 2016
raeburn Tue Aug 16 20:17:54 2016 EDT
Modified files:
/loncom/auth lonwebdavauth.pm lonacc.pm
/loncom lontrans.pm
Log:
- Support Apache 2.4 using $r->get_remote_host() from Apache2::compat().
Index: loncom/auth/lonwebdavauth.pm
diff -u loncom/auth/lonwebdavauth.pm:1.5 loncom/auth/lonwebdavauth.pm:1.6
--- loncom/auth/lonwebdavauth.pm:1.5 Sat May 30 00:11:04 2015
+++ loncom/auth/lonwebdavauth.pm Tue Aug 16 20:17:49 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Authentication Handler for webDAV access to Authoring Space.
#
-# $Id: lonwebdavauth.pm,v 1.5 2015/05/30 00:11:04 raeburn Exp $
+# $Id: lonwebdavauth.pm,v 1.6 2016/08/16 20:17:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -291,11 +291,7 @@
\%userenv,\%domdef,\%is_adv);
@env{keys(%disk_env)} = @disk_env{keys(%disk_env)};
untie(%disk_env);
- my $ip;
- my $c = $r->connection;
- if (ref($c)) {
- $ip = $c->remote_ip;
- }
+ my $ip = $r->get_remote_host();
&Apache::lonnet::log($udom,$uname,$uhome,
"Login webdav/$author $ip");
}
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.163 loncom/auth/lonacc.pm:1.164
--- loncom/auth/lonacc.pm:1.163 Sat Feb 20 00:12:49 2016
+++ loncom/auth/lonacc.pm Tue Aug 16 20:17:49 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Cookie Based Access Handler
#
-# $Id: lonacc.pm,v 1.163 2016/02/20 00:12:49 raeburn Exp $
+# $Id: lonacc.pm,v 1.164 2016/08/16 20:17:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -360,14 +360,7 @@
} else {
# need to login them in, so generate the need data that
# migrate expects to do login
- my $ip;
- my $c = $r->connection;
- eval {
- $ip = $c->remote_ip();
- };
- if ($@) {
- $ip = $c->client_ip();
- }
+ my $ip = $r->get_remote_host();
my %info=('ip' => $ip,
'domain' => $domain,
'username' => $user,
Index: loncom/lontrans.pm
diff -u loncom/lontrans.pm:1.15 loncom/lontrans.pm:1.16
--- loncom/lontrans.pm:1.15 Mon Jul 25 19:49:45 2016
+++ loncom/lontrans.pm Tue Aug 16 20:17:54 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network
# URL translation for User Files
#
-# $Id: lontrans.pm,v 1.15 2016/07/25 19:49:45 raeburn Exp $
+# $Id: lontrans.pm,v 1.16 2016/08/16 20:17:54 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,15 +42,12 @@
my $host = $r->headers_in->get('Host');
if ($host) {
unless ($host =~ /^internal\-/) {
- my $c = $r->connection;
- if (ref($c)) {
- my $remote_ip = $c->remote_ip;
- my $lonhost = $r->dir_config('lonHostID');
- if (&redirect_raw($remote_ip,$lonhost)) {
- my $location = 'https://internal-'.$host.$r->uri;
- $r->headers_out->set(Location => $location);
- return REDIRECT;
- }
+ my $remote_ip = $r->get_remote_host();
+ my $lonhost = $r->dir_config('lonHostID');
+ if (&redirect_raw($remote_ip,$lonhost)) {
+ my $location = 'https://internal-'.$host.$r->uri;
+ $r->headers_out->set(Location => $location);
+ return REDIRECT;
}
}
}
More information about the LON-CAPA-cvs
mailing list