From 7d98d3d8a87d9adfdf8470361275ab5f9d9b933d Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 2 Jun 2010 18:13:30 -0400 Subject: [PATCH] Framework: Fix LDAP finding user's DN (fixes authentication) --- framework/Auth/lib/Horde/Auth/Ldap.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/Auth/lib/Horde/Auth/Ldap.php b/framework/Auth/lib/Horde/Auth/Ldap.php index 6e11b9698..0f20dccad 100644 --- a/framework/Auth/lib/Horde/Auth/Ldap.php +++ b/framework/Auth/lib/Horde/Auth/Ldap.php @@ -96,7 +96,9 @@ class Horde_Auth_Ldap extends Horde_Auth_Base throw new Horde_Auth_Exception('Empty result.'); } - return $search[0]['dn']; + $entry = $search->shiftEntry(); + + return $entry->currentDN(); } /** @@ -213,6 +215,7 @@ class Horde_Auth_Ldap extends Horde_Auth_Base protected function _authenticate($userId, $credentials) { /* Search for the user's full DN. */ + $this->_ldap->bind(); $dn = $this->_findDN($userId); /* Attempt to bind to the LDAP server as the user. */ -- 2.11.0