summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-07-31 11:27:23 +0200
committerbugreport%peshkin.net <>2004-07-31 11:27:23 +0200
commit4c1db37570469aef2c7cc9f2ad9f859560ca8851 (patch)
tree17a519e7f08a85993b710ecd6d809bd9e4b40211 /Bugzilla.pm
parent1ffd632931b05caea45f9c48079b455d156086be (diff)
downloadbugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.gz
bugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.xz
Bug 253588: Change Bugzilla->user to be usable even for a logged-out user
patch by erik,joel r=kiko a=justdave
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm14
1 files changed, 9 insertions, 5 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 56a8d615c..1c2a6a4b0 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -51,6 +51,11 @@ sub cgi {
my $_user;
sub user {
my $class = shift;
+
+ if (not defined $_user) {
+ $_user = new Bugzilla::User;
+ }
+
return $_user;
}
@@ -61,12 +66,11 @@ sub login {
sub logout {
my ($class, $option) = @_;
- if (! $_user) {
- # If we're not logged in, go away
- return;
- }
- $option = LOGOUT_CURRENT unless defined $option;
+ # If we're not logged in, go away
+ return unless user->id;
+
+ $option = LOGOUT_CURRENT unless defined $option;
Bugzilla::Auth::Login::WWW->logout($_user, $option);
}