From 9c884e4b94cd4ac05c5159965db9ae54c5b482e6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 21 May 2007 06:54:55 +0000 Subject: [PATCH] "fix for bug #764: \"Hide accounts from addressbook\" does not work with contacts in LDAP" --- addressbook/inc/class.so_ldap.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.so_ldap.inc.php b/addressbook/inc/class.so_ldap.inc.php index 79becdf1c3..4175afbc22 100644 --- a/addressbook/inc/class.so_ldap.inc.php +++ b/addressbook/inc/class.so_ldap.inc.php @@ -702,7 +702,7 @@ class so_ldap $filters = ''; foreach($filter as $key => $value) { - if ($key != 'cat_id' && !$value) continue; + if ($key != 'cat_id' && $key != 'account_id' && !$value) continue; switch((string) $key) { @@ -710,6 +710,18 @@ class so_ldap case 'tid': // ignored break; + case 'account_id': + if (is_null($value)) + { + $filters .= '(!(uidNumber=*))'; + } + elseif ($value) + { + $filters .= '(uidNumber='.ldap::quote($value).')'; + + } + break; + case 'cat_id': if (is_null($value)) {