--- loncom/auth/lonauth.pm 2010/03/10 21:25:29 1.102 +++ loncom/auth/lonauth.pm 2010/03/22 20:11:08 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.102 2010/03/10 21:25:29 droeschl Exp $ +# $Id: lonauth.pm,v 1.104 2010/03/22 20:11:08 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -117,8 +117,7 @@ sub success { 'text' => 'Successful Login'},]; my $start_page=&Apache::loncommon::start_page('Successful Login', $header, - {'no_inline_link' => 1, - 'bread_crumbs' => $brcrum,}); + {'bread_crumbs' => $brcrum,}); my $end_page =&Apache::loncommon::end_page(); my $continuelink=''.&mt('Continue').''; @@ -149,8 +148,7 @@ ENDSUCCESS sub failed { my ($r,$message,$form) = @_; - my $start_page = &Apache::loncommon::start_page('Unsuccessful Login',undef, - {'no_inline_link' => 1,}); + my $start_page = &Apache::loncommon::start_page('Unsuccessful Login',undef); my $retry = '/adm/login?username='.$form->{'uname'}. '&domain='.$form->{'udom'}; if (exists($form->{role})) { @@ -200,23 +198,29 @@ sub handler { # -------------------------------- Prevent users from attempting to login twice my $handle = &Apache::lonnet::check_for_valid_session($r); if ($handle ne '') { + my $lonidsdir=$r->dir_config('lonIDsDir'); + if ($handle=~/^publicuser\_/) { +# For "public user" - remove it, we apparently really want to login + unlink($r->dir_config('lonIDsDir')."/$handle.id"); + } else { # Indeed, a valid token is found - &Apache::loncommon::content_type($r,'text/html'); - $r->send_http_header; - my $start_page = - &Apache::loncommon::start_page('Already logged in'); - my $end_page = - &Apache::loncommon::end_page(); - $r->print( - $start_page - .'

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

' - .'

'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].' + &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + my $start_page = + &Apache::loncommon::start_page('Already logged in'); + my $end_page = + &Apache::loncommon::end_page(); + $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 - ); - return OK; + .'

' + .$end_page + ); + return OK; + } } # ---------------------------------------------------- No valid token, continue @@ -341,8 +345,7 @@ sub handler { &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'}); if (grep(/^login$/,@cancreate)) { my $start_page = - &Apache::loncommon::start_page('Create a user account in LON-CAPA', - '',{'no_inline_link' => 1,}); + &Apache::loncommon::start_page('Create a user account in LON-CAPA'); my $domdesc = &Apache::lonnet::domain($form{'udom'},'description'); my $lonhost = $r->dir_config('lonHostID'); my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};