summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-07-12 12:48:45 +0200
committerbugreport%peshkin.net <>2004-07-12 12:48:45 +0200
commitabdd4eba8b321e66d9a86d2d3592893f69632618 (patch)
tree305a5c0f7857f37f576b0969dc46f9ff2950b14a /Bugzilla.pm
parentce983f5d751e61c5500eac45e5db29eee7309520 (diff)
downloadbugzilla-abdd4eba8b321e66d9a86d2d3592893f69632618.tar.gz
bugzilla-abdd4eba8b321e66d9a86d2d3592893f69632618.tar.xz
Backing out bug 241900
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm41
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!
}