summaryrefslogtreecommitdiff
path: root/plugins/LdapAuthorization
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-02-24 23:20:34 -0500
committerCraig Andrews <candrews@integralblue.com>2010-02-24 23:20:34 -0500
commit489bd935ebdaf607e18f0befe2ad85ed905728ad (patch)
treee6f717dac37a7a511a74ed98a20010c5c6fd418b /plugins/LdapAuthorization
parentbeb776cfd6b9b78d1f192d55e7e8bc311a0d00ea (diff)
Make LDAP connection error fatal - there really is no way to recover from that.
Diffstat (limited to 'plugins/LdapAuthorization')
-rw-r--r--plugins/LdapAuthorization/LdapAuthorizationPlugin.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
index 7f48ce5e1..19aff42b8 100644
--- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
+++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php
@@ -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