--- loncom/auth/lonauth.pm 2012/08/06 23:14:04 1.121.2.1 +++ loncom/auth/lonauth.pm 2012/08/27 11:55:26 1.121.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.121.2.1 2012/08/06 23:14:04 raeburn Exp $ +# $Id: lonauth.pm,v 1.121.2.2 2012/08/27 11:55:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -146,16 +146,20 @@ sub success { my %lt=&Apache::lonlocal::texthash( 'wel' => 'Welcome', 'pro' => 'Login problems?', - 'log' => 'loginproblems.html', ); + my $loginhelp = &loginhelpdisplay($domain); + if ($loginhelp) { + $loginhelp = '

'.$lt{'pro'}.'

'; + } + my $welcome = &mt('Welcome to the Learning[_1]Online[_2] Network with CAPA. Please wait while your session is being set up.','',''); $r->print(<$lt{'wel'} -$welcome

-$lt{'pro'}

+$welcome +$loginhelp $remoteinfo $maincall $continuelink @@ -179,13 +183,18 @@ sub failed { my $end_page = &Apache::loncommon::end_page(); &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + my $loginhelp = &loginhelpdisplay($form->{'udom'}); + if ($loginhelp) { + $loginhelp = '

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

'; + } + $r->print( $start_page .'

'.&mt('Sorry ...').'

' .'

'.&mt($message).'

' .'

'.&mt('Please [_1]log in again[_2].','','') .'

' - .'

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

' + .$loginhelp .$end_page ); } @@ -554,6 +563,33 @@ sub noswitch { return $result; } +sub loginhelpdisplay { + my ($authdomain) = @_; + my $login_help = 1; + my $lang = &Apache::lonlocal::current_language(); + if ($login_help) { + my $dom = $authdomain; + if ($dom eq '') { + $dom = &Apache::lonnet::default_login_domain(); + } + my %domconfhash = &Apache::loncommon::get_domainconf($dom); + my $loginhelp_url; + if ($lang) { + $loginhelp_url = $domconfhash{$dom.'.login.helpurl_'.$lang}; + if ($loginhelp_url ne '') { + return $loginhelp_url; + } + } + $loginhelp_url = $domconfhash{$dom.'.login.helpurl_nolang'}; + if ($loginhelp_url ne '') { + return $loginhelp_url; + } else { + return '/adm/loginproblems.html'; + } + } + return; +} + 1; __END__