summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_ldap.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-01 09:46:29 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-01 09:46:29 +0200
commitec433114236f9e1871ec5ff9d5d19de50ab236fd (patch)
tree3cd899ee3d3ac0b266604bea3bfad13b60765773 /program/lib/Roundcube/rcube_ldap.php
parent40d419d994811bad3aab147eec3ddc54d0bad3b2 (diff)
Fix so addressbook_search_mode works also for group search (#1489079)
Diffstat (limited to 'program/lib/Roundcube/rcube_ldap.php')
-rw-r--r--program/lib/Roundcube/rcube_ldap.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php
index bae72b724..47e96c32b 100644
--- a/program/lib/Roundcube/rcube_ldap.php
+++ b/program/lib/Roundcube/rcube_ldap.php
@@ -1715,9 +1715,14 @@ class rcube_ldap extends rcube_addressbook
* List all active contact groups of this source
*
* @param string Optional search string to match group name
+ * @param int Matching mode:
+ * 0 - partial (*abc*),
+ * 1 - strict (=),
+ * 2 - prefix (abc*)
+ *
* @return array Indexed list of contact groups, each a hash array
*/
- function list_groups($search = null)
+ function list_groups($search = null, $mode = 0)
{
if (!$this->groups)
return array();
@@ -1729,10 +1734,10 @@ class rcube_ldap extends rcube_addressbook
$groups = array();
if ($search) {
- $search = mb_strtolower($search);
foreach ($group_cache as $group) {
- if (strpos(mb_strtolower($group['name']), $search) !== false)
+ if ($this->compare_search_value('name', $group['name'], $search, $mode)) {
$groups[] = $group;
+ }
}
}
else