version 1.28, 2007/10/01 20:36:37
|
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); |