--- loncom/auth/lonlogout.pm 2006/11/23 01:49:41 1.22 +++ loncom/auth/lonlogout.pm 2007/10/01 20:36:37 1.28 @@ -1,7 +1,7 @@ # The LearningOnline Network # Logout Handler # -# $Id: lonlogout.pm,v 1.22 2006/11/23 01:49:41 albertel Exp $ +# $Id: lonlogout.pm,v 1.28 2007/10/01 20:36:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -66,7 +66,15 @@ sub handler { $env{'user.name'}, $env{'user.home'}, "Logout $ENV{'REMOTE_ADDR'}"); + &Apache::loncommon::content_type($r,'text/html'); + + #expire the cookie + my $c = new CGI::Cookie(-name => 'lonID', + -value => '', + -expires => '-10y',); + $r->header_out('Set-cookie' => $c); + $r->send_http_header; return OK if $r->header_only; # -------------------------------------------------------- Menu script and info @@ -91,16 +99,32 @@ sub handler { 'li' => 'log in again', 'pe' => 'Please either', 'or' => 'or'); - my $login_url = '/adm/'.($env{'request.sso.login'} ? 'roles' - : 'login'); - $relogmessage=(<$lt{'gb'}! +ENDRELOG + + if (!$env{'request.sso.norelogin'}) { + my $relogin_server; + if ($env{'request.sso.reloginserver'}) { + $relogin_server = $env{'request.sso.reloginserver'}; + } + my $login_url = $relogin_server.'/adm/'. + ($env{'request.sso.login'} ? 'roles': 'login'); + + $relogmessage.=(<$lt{'cw'} $lt{'or'} $lt{'li'}. ENDRELOG + } + my $domain = $env{'user.domain'}; if ($env{'request.sso.login'} + && defined($r->dir_config("lonSSOUserLogoutMessageFile_$domain"))) { + open(my $fh,$r->dir_config("lonSSOUserLogoutMessageFile_$domain")); + $relogmessage.= join('',<$fh>); + } + if ($env{'request.sso.login'} && defined($r->dir_config('lonSSOUserLogoutMessageFile'))) { open(my $fh,$r->dir_config('lonSSOUserLogoutMessageFile')); $relogmessage.= join('',<$fh>); @@ -115,10 +139,15 @@ $windowinfo $relogmessage $end_page ENDDOCUMENT - &Apache::lonnet::flushcourselogs(); + $r->register_cleanup(\&flush_course_logs); return OK; } +sub flush_course_logs { + &Apache::lonnet::flushcourselogs(); + return OK; +} + 1; __END__ 500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.