From d56f69615e6d5ba6e39a858f7da2cccc3af82702 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 21 Jun 2011 13:53:42 +0000 Subject: [PATCH] regard addressbook preference to hide accounts or not in ajax search for emailadresses while composing messages, even if accountstorage is the same as the authmechanismn --- felamimail/inc/class.ajax_contacts.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/felamimail/inc/class.ajax_contacts.inc.php b/felamimail/inc/class.ajax_contacts.inc.php index a8f6e956aa..d4b3dd71b2 100644 --- a/felamimail/inc/class.ajax_contacts.inc.php +++ b/felamimail/inc/class.ajax_contacts.inc.php @@ -12,7 +12,7 @@ * option) any later version. * \***************************************************************************/ - /* $Id: class.ajaxfelamimail.inc.php 21848 2006-06-15 21:50:59Z ralfbecker $ */ + /* $Id$ */ class ajax_contacts { function ajax_contacts() { @@ -24,14 +24,14 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook']) { if (method_exists($GLOBALS['egw']->contacts,'search')) { // 1.3+ + $showAccounts = true; + if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $showAccounts=false; $contacts = $GLOBALS['egw']->contacts->search(array( 'n_fn' => $_searchString, 'email' => $_searchString, 'email_home' => $_searchString, - ),array('n_fn','email','email_home'),'n_fn','','%',false,'OR',array(0,20)); + ),array('n_fn','email','email_home'),'n_fn','','%',false,'OR',array(0,20),($showAccounts?array():array('account_id' => null))); - $showAccounts = true; - if ($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts']) $showAccounts=false; // additionally search the accounts, if the contact storage is not the account storage if ($showAccounts && $GLOBALS['egw_info']['server']['account_repository'] == 'ldap' &&