diff options
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r-- | Bugzilla.pm | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 84cc2d721..5cee520c7 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -18,7 +18,6 @@ # Rights Reserved. # # Contributor(s): Bradley Baetz <bbaetz@student.usyd.edu.au> -# Erik Stambaugh <erik@dasbistro.com> # package Bugzilla; @@ -53,10 +52,6 @@ sub user { return $_user; } - - -my $current_login_method = undef; - sub login { my ($class, $type) = @_; @@ -71,18 +66,12 @@ sub login { $type = LOGIN_NORMAL unless defined $type; - # Log in using whatever methods are defined in user_info_method - - my $userid; - for my $method (split(/,\s*/, Param('user_info_method'))) { - require "Bugzilla/Auth/Login/" . $method . ".pm"; - $userid = "Bugzilla::Auth::Login::$method"->login($type); - if ($userid) { - $current_login_method = "Bugzilla::Auth::Login::$method"; - last; - } - } + # For now, we can only log in from a cgi + # One day, we'll be able to log in via apache auth, an email message's + # PGP signature, and so on + use Bugzilla::Auth::CGI; + my $userid = Bugzilla::Auth::CGI->login($type); if ($userid) { $_user = new Bugzilla::User($userid); @@ -108,14 +97,11 @@ sub logout { } $option = LOGOUT_CURRENT unless defined $option; - # $current_login_method is defined when the user's login information is - # found. If it's not defined, the user shouldn't be logged in. - if ($current_login_method) { - $current_login_method->logout($_user, $option); - if ($option != LOGOUT_KEEP_CURRENT) { - $current_login_method->clear_browser_cookies(); - logout_request(); - } + use Bugzilla::Auth::CGI; + Bugzilla::Auth::CGI->logout($_user, $option); + if ($option != LOGOUT_KEEP_CURRENT) { + Bugzilla::Auth::CGI->clear_browser_cookies(); + logout_request(); } } @@ -123,9 +109,8 @@ sub logout_user { my ($class, $user) = @_; # When we're logging out another user we leave cookies alone, and # therefore avoid calling logout() directly. - if ($current_login_method) { - $current_login_method->logout($_user, LOGOUT_ALL); - } + use Bugzilla::Auth::CGI; + Bugzilla::Auth::CGI->logout($user, LOGOUT_ALL); } # just a compatibility front-end to logout_user that gets a user by id @@ -142,7 +127,7 @@ sub logout_request { # XXX clean these up eventually delete $::COOKIE{"Bugzilla_login"}; # NB - Can't delete from $cgi->cookie, so the logincookie data will - # remain there; it's only used in Bugzilla::Auth::Login::CGI->logout anyway + # remain there; it's only used in Bugzilla::Auth::CGI->logout anyway # People shouldn't rely on the cookie param for the username # - use Bugzilla->user instead! } |