mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
LdapResourceForm: Display exact error messages to the user
This commit is contained in:
parent
9d6d76a26d
commit
5fd2eb639a
@ -156,13 +156,8 @@ class LdapResourceForm extends Form
|
||||
{
|
||||
try {
|
||||
$resource = ResourceFactory::createResource(new ConfigObject($form->getValues()));
|
||||
if (false === $resource->testCredentials(
|
||||
$form->getElement('bind_dn')->getValue(),
|
||||
$form->getElement('bind_pw')->getValue()
|
||||
)
|
||||
) {
|
||||
throw new Exception(); // TODO: Get the exact error message
|
||||
}
|
||||
$resource->connect();
|
||||
$resource->bind();
|
||||
} catch (Exception $e) {
|
||||
$msg = $form->translate('Connectivity validation failed, connection to the given resource not possible.');
|
||||
if (($error = $e->getMessage())) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user