version 1.61, 2022/03/10 19:35:18
|
version 1.62, 2022/03/12 21:24:17
|
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) { |
|
document.display.elements['linkprot_secret_$num'].type = 'password'; |
|
} |
|
|
|
ENDJS |
} |
} |
} |
} |
if (@settable) { |
if (@settable) { |
Line 179 ENDJS
|
Line 194 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; |
|
document.display.elements['linkprot_secret_$num'].type = 'password'; |
|
|
|
ENDJS |
} |
} |
} |
} |
($numrules,$intargjs) = |
($numrules,$intargjs) = |
Line 191 secretinput = document.display.elements[
|
Line 211 secretinput = document.display.elements[
|
if (document.display.elements['linkprot_add'].checked) { |
if (document.display.elements['linkprot_add'].checked) { |
$intargjs |
$intargjs |
} |
} |
|
|
ENDJS |
ENDJS |
} |
} |
|
$linkprot_check .= <<ENDJS; |
|
document.display.elements['linkprot_secret_add'].type = 'password'; |
|
|
|
ENDJS |
} |
} |
} |
} |
} |
} |
Line 382 $jscript
|
Line 407 $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 397 $jscript
|
Line 428 $jscript
|
$onload .= "toggleLinkProtReqUser(document.display,'requser','optional','1','block','$num');". |
$onload .= "toggleLinkProtReqUser(document.display,'requser','optional','1','block','$num');". |
"toggleLinkProtReqUser(document.display,'mapuser','userfield','other','inline-block','$num');"; |
"toggleLinkProtReqUser(document.display,'mapuser','userfield','other','inline-block','$num');"; |
} |
} |
|
if ($ishome) { |
|
$onload .= "uncheckLinkProtMakeVis('visible','$num');"; |
|
} |
} |
} |
} |
} |
} |
} |