Diff for /loncom/interface/lonconfigsettings.pm between versions 1.59 and 1.60

version 1.59, 2022/02/15 04:28:01 version 1.60, 2022/02/19 08:53:17
Line 117  ENDSCRIPT Line 117  ENDSCRIPT
                 }                  }
             }              }
             if (($context eq 'course') && ($phase eq 'display') &&              if (($context eq 'course') && ($phase eq 'display') &&
                 (grep(/^linkprotection$/,@actions))) {                  (grep(/^linkprot$/,@actions))) {
                 my $allowed;                  my $allowed;
                 my $home = &Apache::lonnet::homeserver($confname,$dom);                  my $home = &Apache::lonnet::homeserver($confname,$dom);
                 unless ($home eq 'no_host') {                  unless ($home eq 'no_host') {
Line 126  ENDSCRIPT Line 126  ENDSCRIPT
                 }                  }
                 if ($allowed) {                  if ($allowed) {
                     my (@changeable,@settable);                      my (@changeable,@settable);
                     if (ref($values->{'linkprotection'}) eq 'HASH') {                      if (ref($values->{'linkprot'}) eq 'HASH') {
                         if (keys(%{$values->{'linkprotection'}})) {                          if (keys(%{$values->{'linkprot'}})) {
                             my @current = sort { $a <=> $b } keys(%{$values->{'linkprotection'}});                              my @current = sort { $a <=> $b } keys(%{$values->{'linkprot'}});
                             if (@current) {                              if (@current) {
                                 for (my $i=0; $i<@current; $i++) {                                  for (my $i=0; $i<@current; $i++) {
                                     my $num = $current[$i];                                      my $num = $current[$i];
                                     if (ref($values->{'linkprotection'}->{$num}) eq 'HASH') {                                      if (ref($values->{'linkprot'}->{$num}) eq 'HASH') {
                                         if ($values->{'linkprotection'}->{$num}->{'usable'}) {                                          if ($values->{'linkprot'}->{$num}->{'usable'}) {
                                             push(@changeable,$i);                                              push(@changeable,$i);
                                         } else {                                          } else {
                                             push(@settable,$i);                                              push(@settable,$i);
Line 372  $jscript Line 372  $jscript
                     $onload = "courseSet('','load');toggleCloners(document.display.cloners_instcode);";                      $onload = "courseSet('','load');toggleCloners(document.display.cloners_instcode);";
                 }                  }
             }              }
             if (grep(/^linkprotection$/,@actions)) {              if (grep(/^linkprot$/,@actions)) {
                 if (ref($values) eq 'HASH') {                  if (ref($values) eq 'HASH') {
                     if (ref($values->{'linkprotection'}) eq 'HASH') {                      if (ref($values->{'linkprot'}) eq 'HASH') {
                         my $ltiauth;                          my $ltiauth;
                         if (exists($env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'})) {                          if (exists($env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'})) {
                             $ltiauth = $env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'};                              $ltiauth = $env{'course.'.$env{'request.course.id'}.'.internal.ltiauth'};
Line 382  $jscript Line 382  $jscript
                             my %domdefs = &Apache::lonnet::get_domain_defaults($dom);                              my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
                             $ltiauth = $domdefs{'crsltiauth'};                              $ltiauth = $domdefs{'crsltiauth'};
                         }                          }
                         my $posslti = scalar(keys(%{$values->{'linkprotection'}}));                          my $posslti = scalar(keys(%{$values->{'linkprot'}}));
                         for (my $i=0; $i<=$posslti; $i++) {                          for (my $i=0; $i<=$posslti; $i++) {
                             my $num = $i;                              my $num = $i;
                             if ($i == $posslti) {                              if ($i == $posslti) {
                                 $num = 'add';                                  $num = 'add';
                             }                              }
                             if (ref($values->{'linkprotection'}->{$i}) eq 'HASH') {                              if (ref($values->{'linkprot'}->{$i}) eq 'HASH') {
                                 if ($values->{'linkprotection'}->{$i}->{'usable'}) {                                  if ($values->{'linkprot'}->{$i}->{'usable'}) {
                                     $onload .= "toggleLinkProt(document.display,'$num','secret');";                                      $onload .= "toggleLinkProt(document.display,'$num','secret');";
                                 }                                  }
                             }                              }

Removed from v.1.59  
changed lines
  Added in v.1.60


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>