diff options
author | kiko%async.com.br <> | 2003-11-27 10:00:59 +0100 |
---|---|---|
committer | kiko%async.com.br <> | 2003-11-27 10:00:59 +0100 |
commit | cfc22fd3235fd19566152ed9eb4280f58f9926c6 (patch) | |
tree | a9d44b213ee57e61444bd5f1c47314502f927c54 /relogin.cgi | |
parent | 44a7b4d9294e1bffff4362fdf4075059b03eb95a (diff) | |
download | bugzilla-cfc22fd3235fd19566152ed9eb4280f58f9926c6.tar.gz bugzilla-cfc22fd3235fd19566152ed9eb4280f58f9926c6.tar.xz |
Bug 226324: Move relogin.cgi code to Bugzilla::Auth::CGI. Provide a
logout() method that is proxied through Bugzilla.pm's logout(), and fix
callers to use it. r=justdave, bbaetz, a=justdave
Diffstat (limited to 'relogin.cgi')
-rwxr-xr-x | relogin.cgi | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/relogin.cgi b/relogin.cgi index 65cb07b25..b7ba4f61e 100755 --- a/relogin.cgi +++ b/relogin.cgi @@ -23,7 +23,6 @@ use strict; -use vars %::COOKIE; use vars qw($template $vars); use lib qw(.); @@ -37,33 +36,12 @@ require "CGI.pl"; ConnectToDatabase(); quietly_check_login(); -my $cgi = Bugzilla->cgi; - -if ($::userid) { - # Even though we know the userid must match, we still check it in the - # SQL as a sanity check, since there is no locking here, and if - # the user logged out from two machines simulataniously, while someone - # else logged in and got the same cookie, we could be logging the - # other user out here. Yes, this is very very very unlikely, but why - # take chances? - bbaetz - SendSQL("DELETE FROM logincookies WHERE cookie = " . - SqlQuote($::COOKIE{"Bugzilla_logincookie"}) . - "AND userid = $::userid"); -} +Bugzilla->logout(); -$cgi->send_cookie(-name => "Bugzilla_login", - -expires => "Tue, 15-Sep-1998 21:49:00 GMT"); -$cgi->send_cookie(-name => "Bugzilla_logincookie", - -expires => "Tue, 15-Sep-1998 21:49:00 GMT"); - -delete $::COOKIE{"Bugzilla_login"}; +my $cgi = Bugzilla->cgi; +print $cgi->header(); $vars->{'message'} = "logged_out"; - -# This entire script should eventually just become a call to Bugzilla->logout -Bugzilla->logout; - -print $cgi->header(); $template->process("global/message.html.tmpl", $vars) || ThrowTemplateError($template->error()); |