--- loncom/auth/lonlogin.pm 2009/10/06 23:43:21 1.127 +++ loncom/auth/lonlogin.pm 2009/12/04 13:50:48 1.131 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.127 2009/10/06 23:43:21 raeburn Exp $ +# $Id: lonlogin.pm,v 1.131 2009/12/04 13:50:48 jms Exp $ # # Copyright Michigan State University Board of Trustees # @@ -85,13 +85,21 @@ sub handler { if ($env{'form.firsturl'} ne '') { $dest = $env{'form.firsturl'}; } + + my $dom = &Apache::lonnet::default_login_domain(); + my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom); + + my $loginhelp_page = $helpconfig{'helpsettings'}{'loginhelpurl'}; + if ($loginhelp_page eq '') { + $loginhelp_page = '/adm/loginproblems.html'; + } $r->print( $start_page .'

'.&mt('You are already logged in!').'

' .'

'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].', '','','','').'

' - .'

'.&mt('Login problems?').'

' - .$end_page + .'

'.&mt('Login problems?').'

' + .$dom.' '.$end_page ); return OK; } @@ -117,8 +125,7 @@ sub handler { if ($lonhost ne '') { my $loginvia = $domconfhash{$domain.'.login.loginvia_'.$lonhost}; if (($loginvia ne '') && ($loginvia ne $lonhost)) { - my %servers = &Apache::lonnet::get_servers($domain); - if ($servers{$loginvia} ne '') { + if (&Apache::lonnet::hostname($loginvia) ne '') { $r->print(&redirect_page($loginvia)); return OK; } @@ -338,22 +345,23 @@ $r->print(&Apache::loncommon::start_page # ----------------------------------------------------------------------- Texts my %lt=&Apache::lonlocal::texthash( - 'un' => 'Username', - 'pw' => 'Password', - 'dom' => 'Domain', - 'perc' => 'percent', - 'load' => 'Server Load', - 'userload' => 'User Load', - 'catalog' => 'Course Catalog', - 'log' => 'Log in', - 'help' => 'Log-in Help', - 'serv' => 'Server', - 'servadm' => 'Server Administration', - 'helpdesk' => 'Contact Helpdesk', - 'forgotpw' => 'Forgot password?', - 'newuser' => 'New User?', - ); + 'un' => 'Username', + 'pw' => 'Password', + 'dom' => 'Domain', + 'perc' => 'percent', + 'load' => 'Server Load', + 'userload' => 'User Load', + 'catalog' => 'Course/Community Catalog', + 'log' => 'Log in', + 'help' => 'Log-in Help', + 'serv' => 'Server', + 'servadm' => 'Server Administration', + 'helpdesk' => 'Contact Helpdesk', + 'forgotpw' => 'Forgot password?', + 'newuser' => 'New User?', + ); # -------------------------------------------------- Change password field name + my $forgotpw = &forgotpwdisplay(%lt); my $loginhelp = &loginhelpdisplay(%lt); @@ -391,7 +399,7 @@ if (($showcoursecat eq '') || ($showcour } my $newuserlink; if ($shownewuserlink) { - $newuserlink = &newuser_link($lt{'newuser'}).'
'; + $newuserlink = &newuser_link($lt{'newuser'}); } my $logintitle; if ($loginheader eq 'text') { @@ -413,11 +421,11 @@ my $loginform=(< :
-
+
:
-
+
:
-
+
LFORM @@ -450,11 +458,13 @@ HEADER
- $loginhelp
- $forgotpw
- $contactblock
- $newuserlink - $coursecatalog + $loginhelp
+ $forgotpw
+
+ $contactblock
+
+ $newuserlink
+ $coursecatalog
ENDTOP @@ -541,8 +551,8 @@ sub contactdisplay { $showhelpdesk = 1; } if ($servadm && $showadminmail) { - $contactblock .= '   '.$$lt{'servadm'}.':
'. - '      '.$servadm.'
 
'; + $contactblock .= $$lt{'servadm'}.':
'. + ''.$servadm.'
'; } if ($showhelpdesk) { $contactblock .= ''.$lt->{'helpdesk'}.'
'; @@ -563,9 +573,7 @@ function helpdesk() { ENDSCRIPT } - $contactblock .= <<"ENDBLOCK"; -    $version -ENDBLOCK + $contactblock .= $version; return $contactblock; } @@ -582,7 +590,14 @@ sub loginhelpdisplay { my (%lt) = @_; my $login_help = 1; if ($login_help) { - return ''.$lt{'help'}.''; + my $dom = &Apache::lonnet::default_login_domain(); + my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom); + my $loginhelp_url = $helpconfig{'helpsettings'}{'loginhelpurl'}; + if ($loginhelp_url ne '') { + return ''.$lt{'help'}.''; + } else { + return ''.$lt{'help'}.''; + } } return; } @@ -596,7 +611,7 @@ END sub newuser_link { my ($linkname) = @_; - return '   '.$linkname.'
'; + return ''.$linkname.''; } 1;