diff options
author | bugreport%peshkin.net <> | 2004-07-31 09:27:23 +0000 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-07-31 09:27:23 +0000 |
commit | 4c1db37570469aef2c7cc9f2ad9f859560ca8851 (patch) | |
tree | 17a519e7f08a85993b710ecd6d809bd9e4b40211 /Bugzilla.pm | |
parent | Patch for bug 53452: Mid-air collision: allow copy-paste of the comment from ... (diff) | |
download | bugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.gz bugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.bz2 bugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.zip |
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.pm | 14 |
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); } |