diff options
-rw-r--r-- | Bugzilla/WebService/Server.pm | 4 | ||||
-rw-r--r-- | extensions/Example/Extension.pm | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server.pm b/Bugzilla/WebService/Server.pm index 00820358b..e61a1f600 100644 --- a/Bugzilla/WebService/Server.pm +++ b/Bugzilla/WebService/Server.pm @@ -41,6 +41,10 @@ sub handle_login { return if ($class->login_exempt($method) and !defined Bugzilla->input_params->{Bugzilla_login}); Bugzilla->login(); + + Bugzilla::Hook::process( + 'webservice_before_call', + { 'method' => $method, full_method => $full_method }); } sub datetime_format_inbound { diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 09e3fc03f..a42f87b9e 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -955,6 +955,19 @@ sub webservice_error_codes { $error_map->{'example_my_error'} = 10001; } +sub webservice_before_call { + my ($self, $args) = @_; + + # This code doesn't actually *do* anything, it's just here to show you + # how to use this hook. + my $method = $args->{method}; + my $full_method = $args->{full_method}; + + # Uncomment this line to see a line in your webserver's error log whenever + # a webservice call is made + #warn "RPC call $full_method made by ", Bugzilla->user->login, "\n"; +} + sub webservice_fix_credentials { my ($self, $args) = @_; my $rpc = $args->{'rpc'}; |