Diff for /loncom/auth/lonlogin.pm between versions 1.94.2.1 and 1.95

version 1.94.2.1, 2007/10/09 16:48:51 version 1.95, 2007/10/01 21:52:50
Line 69  sub handler { Line 69  sub handler {
   
   
 # -------------------------------- Prevent users from attempting to login twice  # -------------------------------- Prevent users from attempting to login twice
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my $handle = &Apache::lonnet::check_for_valid_session($r);
     my $lonid=$cookies{'lonID'};      if ($handle=~/^publicuser\_/) {
     my $cookie;  
     if ($lonid) {  
  my $handle=&LONCAPA::clean_handle($lonid->value);  
         my $lonidsdir=$r->dir_config('lonIDsDir');  
  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  # For "public user" - remove it, we apparently really want to login
  unlink("$lonidsdir/$handle.id");   unlink($r->dir_config('lonIDsDir')."/$handle.id");
     } elsif ($handle ne '') {      } elsif ($handle ne '') {
 # Indeed, a valid token is found  # Indeed, a valid token is found
  my $start_page =    my $start_page = 
     &Apache::loncommon::start_page('Already logged in');      &Apache::loncommon::start_page('Already logged in');
  my $end_page =    my $end_page = 
     &Apache::loncommon::end_page();      &Apache::loncommon::end_page();
  $r->print(<<ENDFAILED);   $r->print(<<ENDFAILED);
 $start_page  $start_page
 <h1>You are already logged in</h1>  <h1>You are already logged in</h1>
 <p>Please either <a href="/adm/roles">continue the current session</a> or  <p>Please either <a href="/adm/roles">continue the current session</a> or
Line 95  $start_page Line 88  $start_page
 <a href="/adm/loginproblems.html">Problems?</a></p>  <a href="/adm/loginproblems.html">Problems?</a></p>
 $end_page  $end_page
 ENDFAILED  ENDFAILED
                 return OK;          return OK;
      }    
  }  
     }      }
   
 # ---------------------------------------------------- No valid token, continue  # ---------------------------------------------------- No valid token, continue
Line 158  ENDFAILED Line 149  ENDFAILED
     my $otherserver= &Apache::lonnet::absolute_url($host_name);      my $otherserver= &Apache::lonnet::absolute_url($host_name);
     my $firsturl=      my $firsturl=
     ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});      ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});
 # ---------------------------------------------------------- Are we overloaded?  # ---------------------------------------- Are we access server and overloaded?
     if ((($userloadpercent>100.0)||($loadpercent>100.0))) {      if (($role eq 'access') &&
    (($userloadpercent>100.0)||($loadpercent>100.0))) {
         my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);          my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
  if ($unloaded) { $otherserver=$unloaded; }   if ($unloaded) { $otherserver=$unloaded; }
     }      }

Removed from v.1.94.2.1  
changed lines
  Added in v.1.95


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>