From 70540fb131c58cf4fb012854759eef2d73528a30 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 7 Aug 2008 04:38:22 +0000 Subject: Bug 438435: Need code hooks for authentication Patch By Max Kanat-Alexander r=LpSolit, a=mkanat --- Bugzilla/Config.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Config.pm') diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index 428c13fe5..3666861f0 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -34,6 +34,7 @@ use strict; use base qw(Exporter); use Bugzilla::Constants; +use Bugzilla::Hook; use Data::Dumper; use File::Temp; @@ -54,15 +55,21 @@ our %params; # Load in the param definitions sub _load_params { my $panels = param_panels(); + my %hook_panels; foreach my $panel (keys %$panels) { my $module = $panels->{$panel}; eval("require $module") || die $@; - my @new_param_list = "$module"->get_param_list(); + my @new_param_list = $module->get_param_list(); + $hook_panels{lc($panel)} = { params => \@new_param_list }; foreach my $item (@new_param_list) { $params{$item->{'name'}} = $item; } push(@param_list, @new_param_list); } + # This hook is also called in editparams.cgi. This call here is required + # to make SetParam work. + Bugzilla::Hook::process('config-modify_panels', + { panels => \%hook_panels }); } # END INIT CODE @@ -77,7 +84,8 @@ sub param_panels { $param_panels->{$module} = "Bugzilla::Config::$module" unless $module eq 'Common'; } # Now check for any hooked params - Bugzilla::Hook::process('config', { config => $param_panels }); + Bugzilla::Hook::process('config-add_panels', + { panel_modules => $param_panels }); return $param_panels; } -- cgit v1.2.3-24-g4f1b