From cfc22fd3235fd19566152ed9eb4280f58f9926c6 Mon Sep 17 00:00:00 2001 From: "kiko%async.com.br" <> Date: Thu, 27 Nov 2003 09:00:59 +0000 Subject: 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 --- relogin.cgi | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'relogin.cgi') 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()); -- cgit v1.2.3-24-g4f1b