From 6b603da6f16591b63f809ef967554d260bd0d891 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 15 Aug 2007 16:28:01 -0400
Subject: [PATCH] LDAP improvements

---
 program/include/rcube_ldap.inc |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/program/include/rcube_ldap.inc b/program/include/rcube_ldap.inc
index 976b73d..e6a15d9 100644
--- a/program/include/rcube_ldap.inc
+++ b/program/include/rcube_ldap.inc
@@ -58,7 +58,6 @@
       if (preg_match('/^(.+)_field$/', $prop, $matches))
         $this->fieldmap[$matches[1]] = $value;
     
-    // $this->filter = "(dn=*)";
     $this->connect();
   }
 
@@ -142,7 +141,10 @@
   function close()
   {
     if ($this->conn)
+    {
       @ldap_unbind($this->conn);
+      $this->conn = null;
+    }
   }
 
 
@@ -212,6 +214,13 @@
    */
   function list_records($cols=null, $subset=0)
   {
+    // add general filter to query
+    if (!empty($this->prop['filter']))
+    {
+      $filter = $this->prop['filter'];
+      $this->set_search_set($filter);
+    }
+    
     // exec LDAP search if no result resource is stored
     if ($this->conn && !$this->ldap_result)
       $this->_exec_search();
@@ -442,4 +451,4 @@
 
 }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1