version 1.26, 2007/08/18 00:34:27
|
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 125 ENDRELOG
|
Line 118 ENDRELOG
|
$relogmessage.= join('',<$fh>); |
$relogmessage.= join('',<$fh>); |
} |
} |
if ($env{'request.sso.login'} |
if ($env{'request.sso.login'} |
|| defined($r->dir_config('lonSSOUserLogoutMessageFile'))) { |
&& defined($r->dir_config('lonSSOUserLogoutMessageFile'))) { |
open(my $fh,$r->dir_config('lonSSOUserLogoutMessageFile')); |
open(my $fh,$r->dir_config('lonSSOUserLogoutMessageFile')); |
$relogmessage.= join('',<$fh>); |
$relogmessage.= join('',<$fh>); |
} |
} |
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__ |
|
|