summaryrefslogtreecommitdiff
path: root/program/include/rcube_ldap.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-11-06 21:02:23 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2012-11-06 21:02:23 +0100
commita5c8786a34be237a3436b3c96d283462e76a5c3a (patch)
treeeb9f75b84c95f8a46061f8ac5ba2f18267f347fc /program/include/rcube_ldap.php
parentf9a25bd418fb526f0744bbfb1f2c4ffc6e843d03 (diff)
parentb1263ab253a83d16f444ffbf21836b7bbe389cb3 (diff)
Merge branch 'release-0.7' of github.com:roundcube/roundcubemail into release-0.7
Diffstat (limited to 'program/include/rcube_ldap.php')
-rw-r--r--program/include/rcube_ldap.php36
1 files changed, 19 insertions, 17 deletions
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index e3e7a87a0..14c59dd57 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -770,24 +770,26 @@ class rcube_ldap extends rcube_addressbook
for ($i = 0; $i < $entries['count']; $i++) {
$rec = $this->_ldap2result($entries[$i]);
- foreach (array('email', 'name') as $f) {
- $val = mb_strtolower($rec[$f]);
- switch ($mode) {
- case 1:
- $got = ($val == $search);
- break;
- case 2:
- $got = ($search == substr($val, 0, strlen($search)));
- break;
- default:
- $got = (strpos($val, $search) !== false);
- break;
- }
+ foreach ($fields as $f) {
+ foreach ((array)$rec[$f] as $val) {
+ $val = mb_strtolower($val);
+ switch ($mode) {
+ case 1:
+ $got = ($val == $search);
+ break;
+ case 2:
+ $got = ($search == substr($val, 0, strlen($search)));
+ break;
+ default:
+ $got = (strpos($val, $search) !== false);
+ break;
+ }
- if ($got) {
- $this->result->add($rec);
- $this->result->count++;
- break;
+ if ($got) {
+ $this->result->add($rec);
+ $this->result->count++;
+ break 2;
+ }
}
}
}