summaryrefslogtreecommitdiff
path: root/plugins/LdapAuthorization
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/LdapAuthorization')
-rw-r--r--plugins/LdapAuthorization/LdapAuthorizationPlugin.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
index 19aff42b8..2608025dd 100644
--- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
+++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
@@ -167,6 +167,11 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
$err=$ldap->bind();
if (Net_LDAP2::isError($err)) {
+ // if we were called with a config, assume caller will handle
+ // incorrect username/password (LDAP_INVALID_CREDENTIALS)
+ if (isset($config) && $err->getCode() == 0x31) {
+ return null;
+ }
throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
return false;
}