Diff for /loncom/interface/lonconfigsettings.pm between versions 1.61 and 1.67

version 1.61, 2022/03/10 19:35:18 version 1.67, 2022/09/08 01:41:13
Line 148  $linkprot_check .= <<ENDJS; Line 148  $linkprot_check .= <<ENDJS;
   
 var linkprotradio = '';  var linkprotradio = '';
 var secretinput = '';   var secretinput = ''; 
   var posscheck = '';
   
 ENDJS  ENDJS
                     if (@changeable) {                      if (@changeable) {
                         foreach my $num (@changeable) {                          foreach my $num (@changeable) {
                             ($numrules,$intargjs) =                              ($numrules,$intargjs) =
                                 &Apache::loncommon::passwd_validation_js('secretinput',$dom,'linkprot',$num);                                  &Apache::loncommon::passwd_validation_js('secretinput',$dom,'linkprot',$num);
                             if ($numrules) {                              $linkprot_check .= <<ENDJS;
                                 $linkprot_check .= <<ENDJS;  posscheck = '';
   
 linkprotradio = document.display.elements['linkprot_changesecret_$num'];  linkprotradio = document.display.elements['linkprot_changesecret_$num'];
 secretinput = document.display.elements['linkprot_secret_$num'].value;  
 if (linkprotradio.length) {  if (linkprotradio.length) {
     for (var i=0; i<linkprotradio.length; i++) {      for (var i=0; i<linkprotradio.length; i++) {
         if (linkprotradio[i].checked) {          if (linkprotradio[i].checked) {
             if (linkprotradio[i].value == 1) {              if (linkprotradio[i].value == 1) {
                 $intargjs                  posscheck = 1;
             }              }
         }          }
     }      }
 }  }
   
   ENDJS
                               if ($numrules) {
                                   $linkprot_check .= <<ENDJS;
   if (posscheck) {
       secretinput = document.display.elements['linkprot_secret_$num'].value;
       $intargjs
   }
   
 ENDJS  ENDJS
                             }                              }
                               $linkprot_check .= <<ENDJS;
   if (posscheck) {
       uncheckLinkProtMakeVis('visible','$num');
       document.display.elements['linkprot_secret_$num'].type = 'password';
   }
   
   ENDJS
                         }                          }
                     }                      }
                     if (@settable) {                      if (@settable) {
Line 179  ENDJS Line 195  ENDJS
                                 $linkprot_check .= <<ENDJS;                                  $linkprot_check .= <<ENDJS;
 secretinput = document.display.elements['linkprot_secret_$num'].value;  secretinput = document.display.elements['linkprot_secret_$num'].value;
 $intargjs  $intargjs
   
 ENDJS  ENDJS
                             }                              }
                               $linkprot_check .= <<ENDJS;
   uncheckLinkProtMakeVis('visible','$num');
   document.display.elements['linkprot_secret_$num'].type = 'password';
   
   ENDJS
                         }                          }
                     }                      }
                     ($numrules,$intargjs) =                      ($numrules,$intargjs) =
Line 189  ENDJS Line 211  ENDJS
                         $linkprot_check .= <<ENDJS                          $linkprot_check .= <<ENDJS
 secretinput = document.display.elements['linkprot_secret_add'].value;  secretinput = document.display.elements['linkprot_secret_add'].value;
 if (document.display.elements['linkprot_add'].checked) {  if (document.display.elements['linkprot_add'].checked) {
     $intargjs            $intargjs
 }  }
   
 ENDJS  ENDJS
                     }                      }
                       $linkprot_check .= <<ENDJS;
   uncheckLinkProtMakeVis('visible','add');
   document.display.elements['linkprot_secret_add'].type = 'password';
   
   ENDJS
                 }                  }
             }              }
         }          }
Line 382  $jscript Line 410  $jscript
                             my %domdefs = &Apache::lonnet::get_domain_defaults($dom);                              my %domdefs = &Apache::lonnet::get_domain_defaults($dom);
                             $ltiauth = $domdefs{'crsltiauth'};                              $ltiauth = $domdefs{'crsltiauth'};
                         }                          }
                           my $ishome;
                           my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};
                           unless (($chome eq 'no_host') || ($chome eq '')) {
                               my @ids=&Apache::lonnet::current_machine_ids();
                               foreach my $id (@ids) { if ($id eq $chome) { $ishome=1; } }
                           }
                         my $posslti = scalar(keys(%{$values->{'linkprot'}}));                          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;
Line 393  $jscript Line 427  $jscript
                                     $onload .= "toggleLinkProt(document.display,'$num','secret');";                                      $onload .= "toggleLinkProt(document.display,'$num','secret');";
                                 }                                  }
                             }                              }
                               $onload .= "toggleLinkProtExtra(document.display,'returnurl','divurlparam','1','inline-block','$num');";
                             if ($ltiauth) {                              if ($ltiauth) {
                                 $onload .= "toggleLinkProtReqUser(document.display,'requser','optional','1','block','$num');".                                  $onload .= "toggleLinkProtExtra(document.display,'requser','optional','1','block','$num');".
                                            "toggleLinkProtReqUser(document.display,'mapuser','userfield','other','inline-block','$num');";                                             "toggleLinkProtExtra(document.display,'mapuser','userfield','other','inline-block','$num');";
                               }
                               if ($ishome) {
                                   $onload .= "uncheckLinkProtMakeVis('visible','$num');";
                             }                              }
                         }                          }
                     }                      }
                 }                  }
             }              }
               if (grep(/^appearance$/,@actions)) {
                   $onload .= "toggleExtRes();";
               }
               if (grep(/^localization$/,@actions)) {
                   $onload .= "toggleTimeZone();";
               }
             if ($onload) {              if ($onload) {
                 my %loaditems = (                  my %loaditems = (
                                   'onload' => $onload,                                    'onload' => $onload,
Line 502  sub make_changes { Line 546  sub make_changes {
                     $errors =                      $errors =
                         &Apache::courseprefs::process_changes($dom,$confname,$item,$values,                          &Apache::courseprefs::process_changes($dom,$confname,$item,$values,
                                                               $prefs->{$item},$changes{$item},                                                                $prefs->{$item},$changes{$item},
                                                               $allitems,\%disallowed,$crstype);                                                                $allitems,\%disallowed,$crstype,
                                                                 \%lastact);
                     if (keys(%{$changes{$item}}) > 0) {                      if (keys(%{$changes{$item}}) > 0) {
                         $numchanged ++;                          $numchanged ++;
                     }                      }

Removed from v.1.61  
changed lines
  Added in v.1.67


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