version 1.158.2.13.2.1, 2021/12/31 21:56:01
|
version 1.158.2.13.2.4, 2022/05/29 12:44:12
|
Line 428 sub handler {
|
Line 428 sub handler {
|
if ($uextkey>2147483647) { $uextkey-=4294967296; } |
if ($uextkey>2147483647) { $uextkey-=4294967296; } |
|
|
# -------------------------------------------------------- Store away log token |
# -------------------------------------------------------- Store away log token |
my ($tokenextras,$tokentype); |
my ($tokenextras,$tokentype,$linkprot_for_login); |
my @names = ('role','symb','iptoken','ltoken','linkprot','linkkey'); |
my @names = ('role','symb','iptoken','ltoken','linkprot','linkkey'); |
foreach my $name (@names) { |
foreach my $name (@names) { |
if ($env{'form.'.$name} ne '') { |
if ($env{'form.'.$name} ne '') { |
if ($name eq 'ltoken') { |
if ($name eq 'ltoken') { |
my %info = &Apache::lonnet::tmpget($env{'form.'.$name}); |
my %info = &Apache::lonnet::tmpget($env{'form.'.$name}); |
if ($info{'linkprot'}) { |
if ($info{'linkprot'}) { |
|
$linkprot_for_login = $info{'linkprot'}; |
$tokenextras .= '&linkprot='.&escape($info{'linkprot'}); |
$tokenextras .= '&linkprot='.&escape($info{'linkprot'}); |
$tokentype = 'link'; |
$tokentype = 'link'; |
last; |
last; |
Line 442 sub handler {
|
Line 443 sub handler {
|
} else { |
} else { |
$tokenextras .= '&'.$name.'='.&escape($env{'form.'.$name}); |
$tokenextras .= '&'.$name.'='.&escape($env{'form.'.$name}); |
if (($name eq 'linkkey') || ($name eq 'linkprot')) { |
if (($name eq 'linkkey') || ($name eq 'linkprot')) { |
|
if (($env{'form.retry'}) && (!$env{'form.ltoken'}) && ($name eq 'linkprot')) { |
|
$linkprot_for_login = $env{'form.linkprot'}; |
|
} |
$tokentype = 'link'; |
$tokentype = 'link'; |
} |
} |
} |
} |
Line 654 function toggleLClogin() {
|
Line 658 function toggleLClogin() {
|
if (document.getElementById('LC_login_text')) { |
if (document.getElementById('LC_login_text')) { |
document.getElementById('LC_login_text').innerHTML = '$samlnonsso'; |
document.getElementById('LC_login_text').innerHTML = '$samlnonsso'; |
} |
} |
|
if ( document.client.uname ) { document.client.uname.focus(); } |
if (document.getElementById('LC_SSO_login')) { |
if (document.getElementById('LC_SSO_login')) { |
document.getElementById('LC_SSO_login').style.display = 'none'; |
document.getElementById('LC_SSO_login').style.display = 'none'; |
} |
} |
Line 807 ENDSERVERFORM
|
Line 812 ENDSERVERFORM
|
LFORM |
LFORM |
|
|
if ($showbanner) { |
if ($showbanner) { |
|
my $alttext = &Apache::loncommon::designparm('login.alttext_img',$domain); |
|
if ($alttext eq '') { |
|
$alttext = 'The Learning Online Network with CAPA'; |
|
} |
$r->print(<<HEADER); |
$r->print(<<HEADER); |
<!-- The LON-CAPA Header --> |
<!-- The LON-CAPA Header --> |
<div style="background:$pgbg;margin:0;width:100%;"> |
<div style="background:$pgbg;margin:0;width:100%;"> |
<img src="$img" border="0" alt="The Learning Online Network with CAPA" class="LC_maxwidth" /> |
<img src="$img" border="0" alt="$alttext" class="LC_maxwidth" id="lcloginbanner" /> |
</div> |
</div> |
HEADER |
HEADER |
} |
} |
Line 853 HEADER
|
Line 862 HEADER
|
} |
} |
my $ssohref; |
my $ssohref; |
if ($samlssoimg ne '') { |
if ($samlssoimg ne '') { |
$ssohref = '<a href="'.$ssologin.'" title="'.$samltooltip.'"><img src="'.$samlssoimg.'" alt="'.$samlssoalt.'" /></a>'; |
$ssohref = '<a href="'.$ssologin.'" title="'.$samltooltip.'">'. |
|
'<img src="'.$samlssoimg.'" alt="'.$samlssoalt.'" id="lcssobutton" /></a>'; |
} else { |
} else { |
$ssohref = '<a href="'.$ssologin.'">'.$samlssotext.'</a>'; |
$ssohref = '<a href="'.$ssologin.'">'.$samlssotext.'</a>'; |
} |
} |
Line 887 ENDSAML
|
Line 897 ENDSAML
|
delete($env{'form.ltoken'}); |
delete($env{'form.ltoken'}); |
} |
} |
} |
} |
|
my $in_frame_js; |
|
if ($linkprot_for_login) { |
|
my ($linkprotector,$linkproturi) = split(/:/,$linkprot_for_login,2); |
|
if (($linkprotector =~ /^\d+(c|d)$/) && ($linkproturi =~ m{^/+tiny/+$LONCAPA::match_domain/+\w+$})) { |
|
my $set_target; |
|
if ($env{'form.retry'}) { |
|
if ($linkproturi eq $env{'form.firsturl'}) { |
|
$set_target = " document.server.target = '_self';"; |
|
} |
|
} else { |
|
$set_target = <<ENDTARG; |
|
var linkproturi = '$linkproturi'; |
|
var path = document.location.pathname.replace( new RegExp('^/adm/launch'),''); |
|
if (linkproturi == path) { |
|
document.server.target = '_self'; |
|
} |
|
ENDTARG |
|
} |
|
$in_frame_js = <<ENDJS; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
if ((window.self !== window.top) && (document.server.target != '_self')) { |
|
$set_target |
|
} |
|
// ]]> |
|
</script> |
|
ENDJS |
|
} |
|
} |
|
|
$r->print(<<ENDLOGIN); |
$r->print(<<ENDLOGIN); |
<div style="display:$stdauthformstyle;" id="LC_standard_login"> |
<div style="display:$stdauthformstyle;" id="LC_standard_login"> |
Line 908 ENDSAML
|
Line 947 ENDSAML
|
ENDLOGIN |
ENDLOGIN |
$r->print('</div><div>'."\n"); |
$r->print('</div><div>'."\n"); |
if ($showmainlogo) { |
if ($showmainlogo) { |
$r->print(' <img src="'.$logo.'" alt="" class="LC_maxwidth" />'."\n"); |
my $alttext = &Apache::loncommon::designparm('login.alttext_logo',$domain); |
|
$r->print(' <img src="'.$logo.'" alt="'.$alttext.'" class="LC_maxwidth" id="lcloginmainlogo" />'."\n"); |
} |
} |
$r->print(<<ENDTOP); |
$r->print(<<ENDTOP); |
$announcements |
$announcements |
Line 986 $versionrow
|
Line 1026 $versionrow
|
<br style="clear:both;" /> |
<br style="clear:both;" /> |
</div> |
</div> |
|
|
|
$in_frame_js |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
// the if prevents the script error if the browser can not handle this |
// the if prevents the script error if the browser can not handle this |