Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function call($methodname, $args) |
||
27 | { |
||
28 | try { |
||
29 | $result = $this->remote->call($methodname, $args); |
||
30 | return $result; |
||
31 | } /** @noinspection PhpRedundantCatchClauseInspection */ catch (AccessDeniedException $e) { |
||
32 | if (!isset($_SERVER['REMOTE_USER'])) { |
||
33 | http_status(401); |
||
34 | return new \IXR_Error(-32603, "server error. not authorized to call method $methodname"); |
||
35 | } else { |
||
36 | http_status(403); |
||
37 | return new \IXR_Error(-32604, "server error. forbidden to call the method $methodname"); |
||
38 | } |
||
39 | } catch (RemoteException $e) { |
||
40 | return new \IXR_Error($e->getCode(), $e->getMessage()); |
||
41 | } |
||
42 | } |
||
43 | |||
62 |