diff --git a/api/src/Contacts/Storage.php b/api/src/Contacts/Storage.php index dd2dbac009..f83de18758 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;