From e1335db9c1942e81c13e67aa5feeac4a55f84b13 Mon Sep 17 00:00:00 2001 From: William Mead Date: Wed, 17 Jan 2024 13:26:56 +0100 Subject: [PATCH] Refactored connect_bind return --- htdocs/core/class/ldap.class.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 77bb1ac39de..1fa6372a3db 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -338,7 +338,7 @@ class Ldap if (!function_exists("ldap_connect")) { $this->error = 'LDAPFunctionsNotAvailableOnPHP'; dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING); - $return = -1; + return -1; } if (empty($this->error)) { @@ -443,15 +443,13 @@ class Ldap } if ($connected) { - $return = $connected; - dol_syslog(get_class($this)."::connect_bind return=".$return, LOG_DEBUG); + dol_syslog(get_class($this)."::connect_bind ".$connected, LOG_DEBUG); + return $connected; } else { $this->error = 'Failed to connect to LDAP'.($this->error ? ': '.$this->error : ''); - $return = -1; - dol_syslog(get_class($this)."::connect_bind return=".$return.' - '.$this->error, LOG_WARNING); + dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING); + return -1; } - - return $return; } /**