');
+ if ($saml_landing) {
+ $ssoauthstyle = 'inline-block';
+ $stdauthformstyle = 'none';
+ $logintype = $samlssotext;
+ my $ssologin = '/adm/sso';
+ if ($samlssourl ne '') {
+ $ssologin = $samlssourl;
+ }
+ my $ssologin_for_js = &js_escape($ssologin);
+ my $querystr_for_js;
+ if (($logtoken eq 'con_lost') || ($logtoken eq 'no_such_host')) {
+ my $querystring;
+ if ($env{'form.firsturl'} ne '') {
+ $querystring = 'origurl=';
+ if ($env{'form.firsturl'} =~ /[^\x00-\xFF]/) {
+ $querystring .= &uri_escape_utf8($env{'form.firsturl'});
+ } else {
+ $querystring .= &uri_escape($env{'form.firsturl'});
+ }
+ $querystring = &HTML::Entities::encode($querystring,"'");
+ }
+ if ($env{'form.ltoken'} ne '') {
+ $querystring .= (($querystring eq '')?'':'&') . 'ltoken='.
+ &HTML::Entities::encode(&uri_escape($env{'form.ltoken'}));
+ } elsif ($env{'form.linkkey'}) {
+ $querystring .= (($querystring eq '')?'':'&') . 'linkkey='.
+ &HTML::Entities::encode(&uri_escape($env{'form.linkkey'}));
+ }
+ if ($querystring ne '') {
+ $ssologin .= (($ssologin=~/\?/)?'&':'?') . $querystring;
+ $querystr_for_js = &js_escape($querystring);
+ }
+ } elsif ($logtoken ne '') {
+ $ssologin .= (($ssologin=~/\?/)?'&':'?') . 'logtoken='.$logtoken;
+ $querystr_for_js = &js_escape('logtoken='.$logtoken);
+ }
+ my $ssohref;
+ if ($samlwindow) {
+ $sso_onclick = <<"ENDJS";
+if (document.getElementById('LC_sso_login_link')) {
+ var ssoelem = document.getElementById('LC_sso_login_link')
+ ssoelem.addEventListener('click',samlWinFunction,false);
+ var windows = {};
+ function samlWinFunction(evt) {
+ evt.preventDefault();
+ var url = '$ssologin_for_js';
+ var name = 'lcssowin';
+ var querystr = '$querystr_for_js';
+ if (querystr) {
+ url += '?'+querystr+'&lcssowin=1';
+ } else {
+ url += '?lcssowin=1';
+ }
+ if ((typeof windows[name] !== 'undefined') && (!windows[name].closed)) {
+ windows[name].close();
+ }
+ windows[name]=window.open(url,name,'width=350,height=600');
+ windows[name].focus();
+ return false;
+ }
+}
+ENDJS
+ }
+ if ($samlssoimg ne '') {
+ $ssohref = '
'.
+ '';
+ } else {
+ $ssohref = '
'.$samlssotext.'';
+ }
+ if (($env{'form.saml'} eq 'no') ||
+ (($env{'form.username'} ne '') && ($env{'form.domain'} ne ''))) {
+ $ssoauthstyle = 'none';
+ $stdauthformstyle = 'inline-block';
+ $logintype = $samlnonsso;
+ }
+ $r->print(<
+Log-in type:
+$logintype
+$lt{'change'}
+
+
+
+$ssohref
+$noscript_warning
+
+
+$loginhelp
+$contactblock
+$coursecatalog
+
+
+ENDSAML
+ } else {
+ if ($env{'form.ltoken'}) {
+ &Apache::lonnet::tmpdel($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'}) || ($env{'form.sso'})) {
+ if ($linkproturi eq $env{'form.firsturl'}) {
+ $set_target = " document.server.target = '_self';";
+ }
+ } else {
+ $set_target = <
+//
+
+ENDJS
+ }
+ } elsif ($samlwindow) {
+ $in_frame_js = <
+//
+
+ENDJS
+ }
+
+ $r->print(<
$logintitle
$loginform
@@ -640,10 +1079,11 @@ HEADER
-'."\n");
if ($showmainlogo) {
- $r->print('
'."\n");
+ my $alttext = &Apache::loncommon::designparm('login.alttext_logo',$domain);
+ $r->print('
'."\n");
}
$r->print(<
+$in_frame_js