--- loncom/auth/lonauth.pm 2003/10/30 00:54:57 1.58 +++ loncom/auth/lonauth.pm 2003/11/21 22:10:25 1.60 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.58 2003/10/30 00:54:57 www Exp $ +# $Id: lonauth.pm,v 1.60 2003/11/21 22:10:25 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -184,10 +184,11 @@ sub success { my $setflags=&Apache::lonmenu::setflags(); my $maincall=&Apache::lonmenu::maincall(); my $bodytag=&Apache::loncommon::bodytag('Successful Login'); + my $add=&addcontent(); # ------------------------------------------------- Output for successful login $r->send_cgi_header(<send_cgi_header(<print(<parse($r->header_in('Cookie')); + my $lonid=$cookies{'lonID'}; + my $cookie; + if ($lonid) { + my $handle=$lonid->value; + $handle=~s/\W//g; + my $lonidsdir=$r->dir_config('lonIDsDir'); + if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) { +# Indeed, a valid token is found + $r->send_cgi_header(<print(< + +Already logged in + + +$bodytag +

You are already logged in

+

Please either continue the current session or +logout.

+

+Problems?

+ + +ENDFAILED + return OK; + } + } + +# ---------------------------------------------------- No valid token, continue + + my $buffer; $r->read($buffer,$r->header_in('Content-length'),0); my @pairs=split(/&/,$buffer); @@ -347,7 +397,8 @@ sub handler { return OK; } - if (($firsturl eq '') || ($firsturl eq '/adm/logout')) { + if (($firsturl eq '') || + ($firsturl=~/^\/adm\/(logout|remote)/)) { $firsturl='/adm/roles'; }