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

raeburn raeburn at source.lon-capa.org
Tue Apr 5 08:22:41 EDT 2022


raeburn		Tue Apr  5 12:22:41 2022 EDT

  Modified files:              
    /loncom/interface	loncommon.pm courseprefs.pm 
  Log:
  - Preserve existing settings when other changes are amde to link protection
    configuration in a course.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.127 loncom/interface/loncommon.pm:1.1075.2.127.8.1
--- loncom/interface/loncommon.pm:1.1075.2.127	Sun Apr  2 03:09:27 2017
+++ loncom/interface/loncommon.pm	Wed Feb 19 23:30:26 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.127 2017/04/02 03:09:27 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.127.8.1 2020/02/19 23:30:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4946,8 +4946,14 @@
     if (!defined($acc) || $acc =~ /^\s*$/ || $acc =~/^\s*no\s*$/i) {
         return 1;
     }
+    my $ip;
     my $allowed=0;
-    my $ip=$ENV{'REMOTE_ADDR'} || $clientip || $env{'request.host'};
+    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;
     foreach my $pattern (split(',',$acc)) {
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.106 loncom/interface/courseprefs.pm:1.107
--- loncom/interface/courseprefs.pm:1.106	Sat Mar 12 21:24:17 2022
+++ loncom/interface/courseprefs.pm	Tue Apr  5 12:22:41 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.106 2022/03/12 21:24:17 raeburn Exp $
+# $Id: courseprefs.pm,v 1.107 2022/04/05 12:22:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1656,6 +1656,7 @@
                     }
                 } else {
                     $linkprot{$itemid}{'secret'} = $current{'secret'};
+                    $linkprot{$itemid}{'cipher'} = $current{'cipher'};
                 }
             } elsif ($env{$secretitem} ne '') {
                 if ($privnum && $cipher) {




More information about the LON-CAPA-cvs mailing list