[Kolab-devel] [issue3852] turba: add objectclass filter to search criteria

issues at kolab.org issues at kolab.org
Thu Sep 10 14:13:33 CEST 2009


New submission from Sönke Schwardt-Krummrich <schwardt at univention.de>:

While searching turba uses either an objectclass filter or user defined
criteria but not both. When searching for "name" all ldap object with
matching "cn" attribute will show up. Selecting one returns a "no result"
message.
This patch adds the objectclass filter if definded, so only valid address
book entries are shown.

----------
files: t_turba_HK_UV_addObjectclassFilter.diff
keyword: web client
messages: 21594
nosy: schwardt
priority: minor bug
status: unread
title: turba: add objectclass filter to search criteria

______________________________________
Kolab issue tracker <issues at kolab.org>
<https://issues.kolab.org/issue3852>
______________________________________
-------------- next part --------------
Patch by schwardt at univention.de (Thu Sep 10 11:34:08 2009 +0200):

turba: add objectclass filter to search criteria

While searching turba uses either an objectclass filter or user defined
criteria but not both. When searching for "name" all ldap object with
matching "cn" attribute will show up. Selecting one returns a "no result"
message.
This patch adds the objectclass filter if definded, so only valid address
book entries are shown.


--- a/horde-webmail/turba/lib/Driver/ldap.php
+++ b/horde-webmail/turba/lib/Driver/ldap.php
@@ -155,6 +155,10 @@ class Turba_Driver_ldap extends Turba_Driver {
                     $filter .= '(&' . $this->_buildSearchQuery($vals) . ')';
                 }
             }
+            $objfilter = $this->_buildObjectclassFilter();
+            if (!empty($objfilter)) {
+                $filter = '(&' . $filter . $objfilter . ')';
+            }
         } else {
             /* Filter on objectclass. */
             $filter = $this->_buildObjectclassFilter();


More information about the devel mailing list