Commit 5d919b3d authored by Donal McMullan's avatar Donal McMullan
Browse files

Slightly richer error reporting on failed SSO

parent 1012a356
...@@ -117,7 +117,21 @@ class AuthXmlrpc extends Auth { ...@@ -117,7 +117,21 @@ class AuthXmlrpc extends Auth {
$remoteuser = (object)$client->response; $remoteuser = (object)$client->response;
if (empty($remoteuser) or !property_exists($remoteuser, 'username')) { if (empty($remoteuser) or !property_exists($remoteuser, 'username')) {
throw new MaharaException('Unknown error!'); $errorobject = $remoteuser;
$errreport = 'Authorisation failure. ';
$faultcode = 1;
if (property_exists($errorobject, 'faultCode')) {
$errreport .= "\nCode: ".$errorobject->faultCode;
$faultcode = $errorobject->faultCode;
}
if (property_exists($errorobject, 'faultString')) {
$errreport .= "\nMessage: ".$errorobject->faultString;
}
throw new AccessDeniedException($errreport, $faultcode);
} }
$virgin = false; $virgin = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment