From 84fc0873bf3a840c63dd645f8b22ddac5ae59571 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 17 Oct 2007 13:18:22 +1300 Subject: [PATCH] Make sure the error handling will work if anonymous binding is being used. --- inc/drivers_ldap.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 68e75e2e..d5c7faff 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -62,7 +62,9 @@ class ldapDrivers //connect as root if (!ldap_bind($this->connect,$config['bindDN'],$config['passDN'])){ - $c->messages[] = sprintf(i18n( "drivers_ldap : Unable to bind to LDAP, check your bindDN >%s< and passDN >%s< of your configuration or if your server is reachable"),$config['bindDN'],$config['passDN'] ); + $bindDN = isset($config['bindDN']) ? $config['bindDN'] : 'anonymous'; + $passDN = isset($config['passDN']) ? $config['passDN'] : 'anonymous'; + $c->messages[] = sprintf(i18n( "drivers_ldap : Unable to bind to LDAP, check your bindDN >%s< and passDN >%s< of your configuration or if your server is reachable"),$bindDN,$passDN ); $c->messages[] = sprintf(i18n( "if your use OpenLDAP 2.X.X maybe, unable to connect to LDAP with port %s on host %s"), $port,$host ); $this->valid=false; return ;