diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 38220f7a17b..1d6e51c633d 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -396,7 +396,7 @@ class Ldap public function unbind() { $this->result = true; - if (is_resource($this->connection)) { + if (is_resource($this->connection) || is_object($this->connection)) { $this->result = @ldap_unbind($this->connection); } if ($this->result) {