From 08c0557edb2edcee236986a881822ed3fabbd19d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felipe=20Zipitr=C3=ADa?= <fzipi@fing.edu.uy>
Date: Tue, 4 Jun 2013 19:03:19 -0300
Subject: [PATCH 2/2] Added 'user' parameter, so findUserDN could be used,
 along with some defaults.

---
 passwd/lib/Driver/Ldap.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/passwd/lib/Driver/Ldap.php b/passwd/lib/Driver/Ldap.php
index bbd8fa7..5377be8 100644
--- a/passwd/lib/Driver/Ldap.php
+++ b/passwd/lib/Driver/Ldap.php
@@ -58,7 +58,8 @@ class Passwd_Driver_Ldap extends Passwd_Driver
         // for search to work, we need to define 'user'
         // this way, will be picked correctly by Horde_Ldap
         // when ldap is created, to do the actual search
-        $params['user'] = array('uid' => $params['uid'], 'filter' => $params['filter']);
+        $params['user'] = array('uid' => defined($params['uid']) ? $params['uid'] : 'uid',
+                                'filter' => defined($params['filter']) ? $params['filter'] : 'objectClass=shadowAccount');
 
         parent::__construct(array_merge(array(
             'host' => 'localhost',
-- 
1.8.1.4