--- loncom/auth/lonlogin.pm 2017/10/14 20:59:35 1.158.2.6.2.1 +++ loncom/auth/lonlogin.pm 2018/09/04 01:10:29 1.158.2.7 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.158.2.6.2.1 2017/10/14 20:59:35 raeburn Exp $ +# $Id: lonlogin.pm,v 1.158.2.7 2018/09/04 01:10:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -117,32 +117,24 @@ sub handler { $env{'form.firsturl'} =~ s/(`)/'/g; # -------------------------------- 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::lonnet::transfer_profile_to_env($lonidsdir,$handle); - my $start_page = - &Apache::loncommon::start_page('Already logged in'); - my $end_page = - &Apache::loncommon::end_page(); - my $dest = '/adm/roles'; - if ($env{'form.firsturl'} ne '') { - $dest = $env{'form.firsturl'}; - } - $r->print( - $start_page - .'

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

' - .'

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

' - .$end_page - ); - return OK; + &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); + my $start_page = + &Apache::loncommon::start_page('Already logged in'); + my $end_page = + &Apache::loncommon::end_page(); + my $dest = '/adm/roles'; + if ($env{'form.firsturl'} ne '') { + $dest = $env{'form.firsturl'}; } + $r->print( + $start_page + .'

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

' + .'

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

' + .$end_page + ); + return OK; } # ---------------------------------------------------- No valid token, continue