Show exception message when LDAP connection validation fails, if any

This commit is contained in:
Johannes Meyer 2015-03-12 14:45:16 +01:00
parent ba0154ab79
commit 4a982a382e

View File

@ -119,12 +119,15 @@ class LdapResourceForm extends Form
$form->getElement('bind_pw')->getValue() $form->getElement('bind_pw')->getValue()
) )
) { ) {
throw new Exception(); throw new Exception(); // TODO: Get the exact error message
} }
} catch (Exception $e) { } catch (Exception $e) {
$form->addError( $msg = $form->translate('Connectivity validation failed, connection to the given resource not possible.');
$form->translate('Connectivity validation failed, connection to the given resource not possible.') if (($error = $e->getMessage())) {
); $msg .= ' (' . $error . ')';
}
$form->addError($msg);
return false; return false;
} }