aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth/Login
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-08-07 04:38:22 +0000
committermkanat%bugzilla.org <>2008-08-07 04:38:22 +0000
commit70540fb131c58cf4fb012854759eef2d73528a30 (patch)
tree82b80ac0bebf506a2852a71606f52bda32f195d0 /Bugzilla/Auth/Login
parentbea9199267de2fe96c3214f17b4119ae87dd6a26 (diff)
downloadbugs-70540fb131c58cf4fb012854759eef2d73528a30.tar
bugs-70540fb131c58cf4fb012854759eef2d73528a30.tar.gz
bugs-70540fb131c58cf4fb012854759eef2d73528a30.tar.bz2
bugs-70540fb131c58cf4fb012854759eef2d73528a30.tar.xz
bugs-70540fb131c58cf4fb012854759eef2d73528a30.zip
Bug 438435: Need code hooks for authentication
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/Auth/Login')
-rw-r--r--Bugzilla/Auth/Login/Stack.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/Bugzilla/Auth/Login/Stack.pm b/Bugzilla/Auth/Login/Stack.pm
index d51003861..ab9a93bce 100644
--- a/Bugzilla/Auth/Login/Stack.pm
+++ b/Bugzilla/Auth/Login/Stack.pm
@@ -26,16 +26,24 @@ use fields qw(
_stack
successful
);
+use Hash::Util qw(lock_keys);
+use Bugzilla::Hook;
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
my $list = shift;
+ my %methods = map { $_ => "Bugzilla/Auth/Login/$_.pm" } split(',', $list);
+ lock_keys(%methods);
+ Bugzilla::Hook::process('auth-login_methods', { modules => \%methods });
+
$self->{_stack} = [];
- foreach my $login_method (split(',', $list)) {
- require "Bugzilla/Auth/Login/${login_method}.pm";
- push(@{$self->{_stack}},
- "Bugzilla::Auth::Login::$login_method"->new(@_));
+ foreach my $login_method (keys %methods) {
+ my $module = $methods{$login_method};
+ require $module;
+ $module =~ s|/|::|g;
+ $module =~ s/.pm$//;
+ push(@{$self->{_stack}}, $module->new(@_));
}
return $self;
}