From 3e2637351da9559a4aa420004ac90e9fe30477ef Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Mon, 14 Feb 2011 15:46:48 -0500
Subject: [PATCH] Fulltext search over contact fields. Attention: DATABASE SCHEMA CHANGED\!

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

diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 9c9973f..3cb4748 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -407,6 +407,17 @@
 
         $filter = '(|';
         $wc = !$strict && $this->prop['fuzzy_search'] ? '*' : '';
+        if ($fields != '*')
+        {
+            // search_fields are required for fulltext search
+            if (!$this->prop['search_fields'])
+            {
+                $this->set_error(self::ERROR_SEARCH, 'nofulltextsearch');
+                $this->result = new rcube_result_set();
+                return $this->result;
+            }
+        }
+        
         if (is_array($this->prop['search_fields']))
         {
             foreach ($this->prop['search_fields'] as $k => $field)

--
Gitblit v1.9.1