summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
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);
}