Skip to content

Commit

Permalink
Added more detail error code for unauthorized calls in xmlrpc interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes committed Apr 18, 2012
1 parent bfa6027 commit b2a3342
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/exe/xmlrpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ function call($methodname, $args){
} catch (RemoteAccessDeniedException $e) {
if (!isset($_SERVER['REMOTE_USER'])) {
header('HTTP/1.1 401 Unauthorized');
return new IXR_Error(-32603, "server error. not authorized to call method $methodname");
} else {
header('HTTP/1.1 403 Forbidden');
return new IXR_Error(-32604, "server error. forbidden to call the method $methodname");
}
return new IXR_Error(-32603, "server error. not authorized to call method $methodname");
} catch (RemoteException $e) {
return new IXR_Error($e->getCode(), $e->getMessage());
}
Expand Down

0 comments on commit b2a3342

Please sign in to comment.