From acbc67ea1c9ad96f75d89129dcf19b045fb16556 Mon Sep 17 00:00:00 2001 From: Zbigniew Szmyd Date: Mon, 22 Feb 2016 11:19:28 +0100 Subject: [PATCH] Correction to work good with the Net_LDAP2 2.2.0 --- plugins/password/drivers/ldap.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index 46c783587..06c36df27 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -187,12 +187,14 @@ class rcube_ldap_password ); $result = $ldap->search($base, $filter, $options); - $ldap->done(); if (is_a($result, 'PEAR_Error') || ($result->count() != 1)) { - return ''; + $dn = ''; + } else { + $dn = $result->current()->dn(); } - - return $result->current()->dn(); + $ldap->done(); + + return $dn; } /**