summaryrefslogtreecommitdiffstats
path: root/xmlrpc.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2008-04-17 20:26:12 +0200
committerbbaetz%acm.org <>2008-04-17 20:26:12 +0200
commit22ac4064da3f75f68df8bc939e6d5399f57a3ba8 (patch)
tree9ed8f59fbe364c2c4efc7c96c6e250e60126418a /xmlrpc.cgi
parent32b928bab4ad3715e151bad7aa1609a2dc91266d (diff)
downloadbugzilla-22ac4064da3f75f68df8bc939e6d5399f57a3ba8.tar.gz
bugzilla-22ac4064da3f75f68df8bc939e6d5399f57a3ba8.tar.xz
Bug 428941 – Allow extension webservices to override LOGIN_EXEMPT
r/a=mkanat
Diffstat (limited to 'xmlrpc.cgi')
-rwxr-xr-xxmlrpc.cgi25
1 files changed, 18 insertions, 7 deletions
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;