From 22d216a43eab0dc6528a40a2affaa163cffbd42f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 6 Feb 2017 09:21:50 +0100 Subject: [PATCH] * Addressbook: only add groups as distribution lists, if accounts addressbook is not hidden --- api/src/Contacts/Storage.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/api/src/Contacts/Storage.php b/api/src/Contacts/Storage.php index f83eeeb73c..79a92fc5a3 100755 --- a/api/src/Contacts/Storage.php +++ b/api/src/Contacts/Storage.php @@ -1038,12 +1038,15 @@ class Storage } } - // add groups for all backends - foreach($GLOBALS['egw']->accounts->search(array( - 'type' => 'groups' - )) as $account_id => $group) + // add groups for all backends, if accounts addressbook is not hidden + if (empty($GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'])) { - $lists[(string)$account_id] = Api\Accounts::format_username($group['account_lid'], '', '', $account_id); + foreach($GLOBALS['egw']->accounts->search(array( + 'type' => 'groups' + )) as $account_id => $group) + { + $lists[(string)$account_id] = Api\Accounts::format_username($group['account_lid'], '', '', $account_id); + } } return $lists;