Diff for /loncom/auth/lonlogout.pm between versions 1.27 and 1.29

version 1.27, 2007/08/25 00:51:24 version 1.29, 2007/10/02 01:09:59
Line 41  sub handler { Line 41  sub handler {
   
     #Check for cookie      #Check for cookie
     my $requrl=$r->uri;      my $requrl=$r->uri;
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my $handle = &Apache::lonnet::check_for_valid_session($r);
     my $lonid=$cookies{'lonID'};  
     my $cookie;  
     if (!$lonid) {  
  return FORBIDDEN;  
     }  
   
     #check if cookie still valid      #check if cookie still valid
     my $handle=&LONCAPA::clean_handle($lonid->value);      if ($handle eq '') {
     my $lonidsdir=$r->dir_config('lonIDsDir');  
     if ((!-e "$lonidsdir/$handle.id") || ($handle eq '')) {  
  $r->log_reason("Cookie $handle not valid", $r->filename);    $r->log_reason("Cookie $handle not valid", $r->filename); 
  return FORBIDDEN;   return FORBIDDEN;
     }      }
   
     #we've got a valid user      #we've got a valid user
     my @profile;      my @profile;
       my $lonidsdir=$r->dir_config('lonIDsDir');
     &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);      &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
     unlink("$lonidsdir/$handle.id");      unlink("$lonidsdir/$handle.id");
     my %temp=('logout' => time);      my %temp=('logout' => time);
Line 139  $windowinfo Line 132  $windowinfo
 $relogmessage  $relogmessage
 $end_page  $end_page
 ENDDOCUMENT  ENDDOCUMENT
     &Apache::lonnet::flushcourselogs();      $r->register_cleanup(\&flush_course_logs);
     return OK;       return OK; 
 }  }
   
   sub flush_course_logs {
       &Apache::lonnet::flushcourselogs();
       return OK;
   }
   
 1;  1;
 __END__  __END__
   

Removed from v.1.27  
changed lines
  Added in v.1.29


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