summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorkiko%async.com.br <>2003-11-27 10:00:59 +0100
committerkiko%async.com.br <>2003-11-27 10:00:59 +0100
commitcfc22fd3235fd19566152ed9eb4280f58f9926c6 (patch)
treea9d44b213ee57e61444bd5f1c47314502f927c54 /Bugzilla.pm
parent44a7b4d9294e1bffff4362fdf4075059b03eb95a (diff)
downloadbugzilla-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 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm20
1 files changed, 16 insertions, 4 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 871b76a54..7e7d50004 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -99,8 +99,17 @@ sub login {
}
sub logout {
+ use Bugzilla::Auth::CGI;
+ # remove cookies and clean up database state
+ Bugzilla::Auth::CGI->logout();
+ logout_request();
+}
+
+sub logout_request {
undef $_user;
$::userid = 0;
+ delete $::COOKIE{"Bugzilla_login"};
+ delete $::COOKIE{"Bugzilla_logincookie"};
}
my $_dbh;
@@ -266,10 +275,13 @@ L<Bugzilla::User|Bugzilla::User>.
=item C<logout>
-Logs out the current user. For the moment, this will just cause calls to
-C<user> to return C<undef>. Eventually this will handle deleting cookies from
-the browser and values from the database, which is currently all handled
-by C<relogin.cgi>.
+Logs out the current user.
+
+=item C<logout_request>
+
+Essentially, causes calls to C<user> to return C<undef>. This has the
+effect of logging out a user for the current request only; cookies and
+database state are left intact.
=item C<dbh>