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

raeburn raeburn at source.lon-capa.org
Sat Feb 19 03:53:17 EST 2022


raeburn		Sat Feb 19 08:53:17 2022 EDT

  Modified files:              
    /loncom/interface	lonconfigsettings.pm 
  Log:
  - Name changed from linkprotection to linkprot in courseprefs.pm rev. 1.102
  
  
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.59 loncom/interface/lonconfigsettings.pm:1.60
--- loncom/interface/lonconfigsettings.pm:1.59	Tue Feb 15 04:28:01 2022
+++ loncom/interface/lonconfigsettings.pm	Sat Feb 19 08:53:17 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.59 2022/02/15 04:28:01 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.60 2022/02/19 08:53:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -117,7 +117,7 @@
                 }
             }
             if (($context eq 'course') && ($phase eq 'display') &&
-                (grep(/^linkprotection$/, at actions))) {
+                (grep(/^linkprot$/, at actions))) {
                 my $allowed;
                 my $home = &Apache::lonnet::homeserver($confname,$dom);
                 unless ($home eq 'no_host') {
@@ -126,14 +126,14 @@
                 }
                 if ($allowed) {
                     my (@changeable, at settable);
-                    if (ref($values->{'linkprotection'}) eq 'HASH') {
-                        if (keys(%{$values->{'linkprotection'}})) {
-                            my @current = sort { $a <=> $b } keys(%{$values->{'linkprotection'}});
+                    if (ref($values->{'linkprot'}) eq 'HASH') {
+                        if (keys(%{$values->{'linkprot'}})) {
+                            my @current = sort { $a <=> $b } keys(%{$values->{'linkprot'}});
                             if (@current) {
                                 for (my $i=0; $i<@current; $i++) {
                                     my $num = $current[$i];
-                                    if (ref($values->{'linkprotection'}->{$num}) eq 'HASH') {
-                                        if ($values->{'linkprotection'}->{$num}->{'usable'}) {
+                                    if (ref($values->{'linkprot'}->{$num}) eq 'HASH') {
+                                        if ($values->{'linkprot'}->{$num}->{'usable'}) {
                                             push(@changeable,$i);
                                         } else {
                                             push(@settable,$i);
@@ -372,9 +372,9 @@
                     $onload = "courseSet('','load');toggleCloners(document.display.cloners_instcode);";
                 }
             }
-            if (grep(/^linkprotection$/, at actions)) {
+            if (grep(/^linkprot$/, at actions)) {
                 if (ref($values) eq 'HASH') {
-                    if (ref($values->{'linkprotection'}) eq 'HASH') {
+                    if (ref($values->{'linkprot'}) eq 'HASH') {
                         my $ltiauth;
                         if (exists($env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'})) {
                             $ltiauth = $env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'};
@@ -382,14 +382,14 @@
                             my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
                             $ltiauth = $domdefs{'crsltiauth'};
                         }
-                        my $posslti = scalar(keys(%{$values->{'linkprotection'}}));
+                        my $posslti = scalar(keys(%{$values->{'linkprot'}}));
                         for (my $i=0; $i<=$posslti; $i++) {
                             my $num = $i;
                             if ($i == $posslti) {
                                 $num = 'add';
                             }
-                            if (ref($values->{'linkprotection'}->{$i}) eq 'HASH') {
-                                if ($values->{'linkprotection'}->{$i}->{'usable'}) {
+                            if (ref($values->{'linkprot'}->{$i}) eq 'HASH') {
+                                if ($values->{'linkprot'}->{$i}->{'usable'}) {
                                     $onload .= "toggleLinkProt(document.display,'$num','secret');";
                                 }
                             }




More information about the LON-CAPA-cvs mailing list