');
+ if ($saml_landing) {
+ $ssoauthstyle = 'inline-block';
+ $stdauthformstyle = 'none';
+ $logintype = $samlssotext;
+ my $ssologin = '/adm/sso';
+ if ($samlssourl ne '') {
+ $ssologin = $samlssourl;
+ }
+ my $ssohref;
+ if ($samlssoimg ne '') {
+ $ssohref = '
';
+ } else {
+ $ssohref = '
'.$samlssotext.'';
+ }
+ if ($env{'form.firsturl'}) {
+ $ssologin .= '?origurl='.&HTML::Entities::encode($env{'form.firsturl'},'<>&"');
+ }
+ 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
+ }
+
+ $r->print(<
$logintitle
$loginform
@@ -742,8 +847,8 @@ HEADER
-'."\n");
if ($showmainlogo) {
$r->print('
'."\n");
}
@@ -848,7 +953,7 @@ sub check_loginvia {
my $output;
if ($loginvia ne '') {
my $noredirect;
- my $ip = $ENV{'REMOTE_ADDR'};
+ my $ip = &Apache::lonnet::get_requestor_ip();
if ($ip eq '127.0.0.1') {
$noredirect = 1;
} else {