[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Wed Feb 19 18:19:53 EST 2020


raeburn		Wed Feb 19 23:19:53 2020 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Bug 6922. Revisit changes made in rev. 1.1252
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1338 loncom/interface/loncommon.pm:1.1339
--- loncom/interface/loncommon.pm:1.1338	Sat Feb 15 03:57:54 2020
+++ loncom/interface/loncommon.pm	Wed Feb 19 23:19:52 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1338 2020/02/15 03:57:54 raeburn Exp $
+# $Id: loncommon.pm,v 1.1339 2020/02/19 23:19:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5516,8 +5516,13 @@
     if (!defined($acc) || $acc =~ /^\s*$/ || $acc =~/^\s*no\s*$/i) {
         return 1;
     }
-    my $allowed;
-    my $ip=$ENV{'REMOTE_ADDR'} || $clientip || $env{'request.host'};
+    my ($ip,$allowed);
+    if (($ENV{'REMOTE_ADDR'} eq '127.0.0.1') ||
+        ($ENV{'REMOTE_ADDR'} eq &Apache::lonnet::get_host_ip($Apache::lonnet::perlvar{'lonHostID'}))) {
+        $ip = $env{'request.host'} || $ENV{'REMOTE_ADDR'} || $clientip;
+    } else {
+        $ip = $ENV{'REMOTE_ADDR'} || $env{'request.host'} || $clientip;
+    }
 
     my $name;
     my %access = (




More information about the LON-CAPA-cvs mailing list