diff options
| author | Thomas Bruederli <bruederli@kolabsys.com> | 2012-11-06 21:02:23 +0100 |
|---|---|---|
| committer | Thomas Bruederli <bruederli@kolabsys.com> | 2012-11-06 21:02:23 +0100 |
| commit | a5c8786a34be237a3436b3c96d283462e76a5c3a (patch) | |
| tree | eb9f75b84c95f8a46061f8ac5ba2f18267f347fc /program/include/rcube_ldap.php | |
| parent | f9a25bd418fb526f0744bbfb1f2c4ffc6e843d03 (diff) | |
| parent | b1263ab253a83d16f444ffbf21836b7bbe389cb3 (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.php | 36 |
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; + } } } } |
