Make LDAP connection error fatal - there really is no way to recover from that.
This commit is contained in:
parent
beb776cfd6
commit
489bd935eb
@ -199,8 +199,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
|
||||
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err=$ldap->bind();
|
||||
if (Net_LDAP2::isError($err)) {
|
||||
common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
|
||||
return false;
|
||||
throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
|
||||
}
|
||||
if($config == null) $this->default_ldap=$ldap;
|
||||
|
||||
|
@ -167,7 +167,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
|
||||
$ldap->setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$err=$ldap->bind();
|
||||
if (Net_LDAP2::isError($err)) {
|
||||
common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage());
|
||||
throw new Exception('Could not connect to LDAP server: '.$err->getMessage());
|
||||
return false;
|
||||
}
|
||||
if($config == null) $this->default_ldap=$ldap;
|
||||
@ -185,6 +185,9 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin
|
||||
if($ldap==null) {
|
||||
$ldap = $this->ldap_get_connection();
|
||||
}
|
||||
if(! $ldap) {
|
||||
throw new Exception("Could not connect to LDAP");
|
||||
}
|
||||
$filter = Net_LDAP2_Filter::create($this->attributes['username'], 'equals', $username);
|
||||
$options = array(
|
||||
'attributes' => $attributes
|
||||
|
Loading…
Reference in New Issue
Block a user