From 282a379f4b1d0ac6f50dfabbabb0f0fefc35da4d Mon Sep 17 00:00:00 2001 From: William Mead Date: Wed, 17 Jan 2024 14:38:39 +0100 Subject: [PATCH] Cleaned code --- htdocs/core/class/ldap.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 1fa6372a3db..ef048be0508 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -351,9 +351,9 @@ class Ldap continue; } - if ($this->serverPing($host, $this->serverPort) === true) { + if ($this->serverPing($host, $this->serverPort)) { if ($ldapdebug) { - dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host); + dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host, LOG_DEBUG); } $this->connection = ldap_connect($host, $this->serverPort); } else { @@ -361,10 +361,13 @@ class Ldap // With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so // we test this case and continue in such a case even if serverPing fails. if ($ldapdebug) { - dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host); + dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host, LOG_DEBUG); } $this->connection = ldap_connect($host, $this->serverPort); } else { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing false, no ldap_connect ".$host, LOG_DEBUG); + } continue; } }