--- loncom/auth/lonauth.pm 2011/11/07 18:15:07 1.120 +++ loncom/auth/lonauth.pm 2013/08/13 13:29:09 1.121.2.4 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.120 2011/11/07 18:15:07 raeburn Exp $ +# $Id: lonauth.pm,v 1.121.2.4 2013/08/13 13:29:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -103,7 +103,7 @@ sub success { if ($destsymb =~ /___/) { # FIXME Need to deal with encrypted symbs and urls as needed. my ($map,$resid,$desturl)=split(/___/,$destsymb); - unless ($desturl=~/^(adm|uploaded|editupload|public)/) { + unless ($desturl=~/^(adm|editupload|public)/) { $desturl = &Apache::lonnet::clutter($desturl); } $desturl = &HTML::Entities::encode($desturl,'"<>&'); @@ -120,16 +120,23 @@ sub success { $destination .= 'source=login'; } - my $windowinfo = Apache::lonhtmlcommon::scripttag('self.name="loncapaclient";'); - my $header = ''; + my $windowinfo=&Apache::lonmenu::open($env{'browser.os'}); + my $startupremote=&Apache::lonmenu::startupremote($destination); + my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl); + my $setflags=&Apache::lonmenu::setflags(); + my $maincall=&Apache::lonmenu::maincall(); my $brcrum = [{'href' => '', 'text' => 'Successful Login'},]; my $start_page=&Apache::loncommon::start_page('Successful Login', - $header, - {'bread_crumbs' => $brcrum,}); + $startupremote, + {'no_inline_link' => 1, + 'bread_crumbs' => $brcrum,}); my $end_page =&Apache::loncommon::end_page(); - my $continuelink=''.&mt('Continue').''; + my $continuelink; + if ($env{'environment.remote'} eq 'off') { + $continuelink=''.&mt('Continue').''; + } # ------------------------------------------------- Output for successful login &Apache::loncommon::content_type($r,'text/html'); @@ -139,15 +146,22 @@ 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 $end_page ENDSUCCESS @@ -169,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 ); } @@ -227,7 +246,7 @@ sub handler { } $r->print( $start_page - .'

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

' + .'

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

' .'

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

' @@ -358,7 +377,8 @@ sub handler { return OK; } my $start_page = - &Apache::loncommon::start_page('Create a user account in LON-CAPA'); + &Apache::loncommon::start_page('Create a user account in LON-CAPA', + '',{'no_inline_link' => 1,}); my $lonhost = $r->dir_config('lonHostID'); my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; my $contacts = @@ -543,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__