Fix that ldap auth validation does not send a BIND request

This commit is contained in:
Johannes Meyer 2014-09-29 11:22:43 +02:00
parent 5b3d549e5c
commit 2c44fe34a7
1 changed files with 7 additions and 1 deletions

View File

@ -114,7 +114,13 @@ class LdapResourceForm extends Form
{
try {
$resource = ResourceFactory::createResource(new Zend_Config($form->getValues()));
$resource->connect();
if (false === $resource->testCredentials(
$form->getElement('bind_dn')->getValue(),
$form->getElement('bind_pw')->getValue()
)
) {
throw new Exception();
}
} catch (Exception $e) {
$form->addError(t('Connectivity validation failed, connection to the given resource not possible.'));
return false;