From 22ac4064da3f75f68df8bc939e6d5399f57a3ba8 Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Thu, 17 Apr 2008 18:26:12 +0000 Subject: Bug 428941 – Allow extension webservices to override LOGIN_EXEMPT r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xmlrpc.cgi | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'xmlrpc.cgi') diff --git a/xmlrpc.cgi b/xmlrpc.cgi index a802ac43f..324382ea2 100755 --- a/xmlrpc.cgi +++ b/xmlrpc.cgi @@ -35,12 +35,23 @@ my %hook_dispatch; Bugzilla::Hook::process('webservice', { dispatch => \%hook_dispatch }); local @INC = (bz_locations()->{extensionsdir}, @INC); +my $dispatch = { + 'Bugzilla' => 'Bugzilla::WebService::Bugzilla', + 'Bug' => 'Bugzilla::WebService::Bug', + 'User' => 'Bugzilla::WebService::User', + 'Product' => 'Bugzilla::WebService::Product', + %hook_dispatch +}; + +# The on_action sub needs to be wrapped so that we can work out which +# class to use; when the XMLRPC module calls it theres no indication +# of which dispatch class will be handling it. +# Note that using this to get code thats called before the actual routine +# is a bit of a hack; its meant to be for modifying the SOAPAction +# headers, which XMLRPC doesn't use; it relies on the XMLRPC modules +# using SOAP::Lite internally.... + my $response = Bugzilla::WebService::XMLRPC::Transport::HTTP::CGI - ->dispatch_with({'Bugzilla' => 'Bugzilla::WebService::Bugzilla', - 'Bug' => 'Bugzilla::WebService::Bug', - 'User' => 'Bugzilla::WebService::User', - 'Product' => 'Bugzilla::WebService::Product', - %hook_dispatch - }) - ->on_action(\&Bugzilla::WebService::handle_login) + ->dispatch_with($dispatch) + ->on_action(sub { Bugzilla::WebService::handle_login($dispatch, @_) } ) ->handle; -- cgit v1.2.3-24-g4f1b