--- loncom/auth/lonlogin.pm 2005/11/23 20:46:04 1.69 +++ loncom/auth/lonlogin.pm 2005/11/23 20:58:31 1.70 @@ -1,7 +1,7 @@ # The LearningOnline Network # Login Screen # -# $Id: lonlogin.pm,v 1.69 2005/11/23 20:46:04 www Exp $ +# $Id: lonlogin.pm,v 1.70 2005/11/23 20:58:31 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,10 +60,15 @@ sub handler { my $handle=$lonid->value; $handle=~s/\W//g; my $lonidsdir=$r->dir_config('lonIDsDir'); - if ((-e "$lonidsdir/$handle.id") && ($handle ne '') && ($handle!~/^publicuser\_/)) { + if (-e "$lonidsdir/$handle.id") { +# Is there an existing token file? + if ($handle=~/^publicuser\_/) { +# For "public user" - remove it, we apparently really want to login + unlink("$lonidsdir/$handle.id"); + } elsif ($handle ne '') { # Indeed, a valid token is found - my $bodytag=&Apache::loncommon::bodytag('Already logged in'); - $r->print(<print(< Already logged in @@ -77,7 +82,8 @@ $bodytag ENDFAILED - return OK; + return OK; + } } } @@ -86,8 +92,12 @@ ENDFAILED &Apache::loncommon::get_unprocessed_cgi ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'}, ['interface','username','domain','firsturl','localpath','localres']); - + # ---------------------------- Not possible to really login to domain "public" + if ($env{'form.domain'} eq 'public') { + $env{'form.domain'}=''; + $env{'form.username'}=''; + } # ----------------------------------------------------------- Process Interface $env{'form.interface'}=~s/\W//g;