diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index ef53c77b..ba8d549b 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -65,16 +65,23 @@ class ldapDriver $this->connect=ldap_connect($host); if (! $this->connect){ - if (isset($config['uri'])) + if (isset($config['uri'])) { $c->messages[] = sprintf(translate( 'drivers_ldap : Unable to connect to LDAP with URI: %s'), $config['uri'] ); - else + } else { + if (! $port) $port = 'default'; $c->messages[] = sprintf(translate( 'drivers_ldap : Unable to connect to LDAP with port %s on host %s'), $port, $host ); + } $this->valid=false; return ; + } else { + if (isset($config['uri'])) + dbg_error_log( "LDAP", "drivers_ldap : Connected to LDAP server %s", $config['uri'] ); + elseif ($port) + dbg_error_log( "LDAP", "drivers_ldap : Connected to LDAP server %s, port %s", $host, $port ); + else + dbg_error_log( "LDAP", "drivers_ldap : Connected to LDAP server %s", $host ); } - dbg_error_log( "LDAP", "drivers_ldap : Connected to LDAP server %s",$host ); - // Start TLS if desired (requires protocol version 3) if (isset($config['startTLS'])) { if (!ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3)) {