From 2d3e2bc56108fc014edfaa154237b551daea4cc0 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 21 Sep 2011 07:17:46 -0400
Subject: [PATCH] Add option 'searchonly' for address books; currently used by LDAP directories

---
 program/include/rcube_ldap.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index c6ca88e..13e7b54 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -71,6 +71,9 @@
     function __construct($p, $debug=false, $mail_domain=NULL)
     {
         $this->prop = $p;
+        
+        if (isset($p['searchonly']))
+            $this->searchonly = $p['searchonly'];
 
         // check if groups are configured
         if (is_array($p['groups']) && count($p['groups'])) {
@@ -429,6 +432,12 @@
      */
     function list_records($cols=null, $subset=0)
     {
+        if ($this->prop['searchonly'] && empty($this->filter) && !$this->group_id) {
+            $this->result = new rcube_result_set(0);
+            $this->result->searchonly = true;
+            return $this->result;
+        }
+        
         // add general filter to query
         if (!empty($this->prop['filter']) && empty($this->filter))
         {

--
Gitblit v1.9.1