Commit 7b25f90f authored by Nigel McNie's avatar Nigel McNie

Improved the error reporting of the XMLRPC auth plugin, by catching more...

Improved the error reporting of the XMLRPC auth plugin, by catching more specific exceptions and logging unknown ones. Added a TODO about a bad catch elsewhere
parent 8cca1e9c
......@@ -670,6 +670,7 @@ function change_password_submit(Pieform $form, $values) {
redirect();
}
// TODO: Exception is the wrong type here!
throw new Exception('Attempt by "' . $USER->get('username') . '@'
. $USER->get('institution') . 'to change their password failed');
}
......
......@@ -53,15 +53,20 @@ if (empty($instances)) {
$rpcconfigured = false;
$res = false;
foreach($instances as $instance) {
if ($instance->authname == 'xmlrpc') {
$rpcconfigured = true;
try {
$auth = new AuthXmlrpc($instance->id);
$res = $auth->request_user_authorise($token, $remotewwwroot);
} catch (Exception $e) {
} catch (AccessDeniedException $e) {
continue;
// we don't care - a future plugin might accept the user
}
catch (Exception $e) {
log_info($e);
continue;
// we don't care
}
if ($res == true) {
break;
......
......@@ -148,7 +148,7 @@ class AuthXmlrpc extends Auth {
if ('1' == $this->config['updateuserinfoonlogin']) {
$update = true;
}
} catch (Exception $e) {
} catch (AuthUnknownUserException $e) {
if (!empty($this->config['weautocreateusers'])) {
$user = new User;
$create = true;
......
Markdown is supported
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