if accounts backend is NOT SQL, we need to search that too

This commit is contained in:
Ralf Becker 2019-07-18 14:48:13 +02:00
parent 72bd27587c
commit 76b0bac25e

View File

@ -219,7 +219,15 @@ class addressbook_bo extends Api\Contacts
if (!$criteria) return 0; if (!$criteria) return 0;
$updated = 0; $updated = 0;
foreach((array)$this->search($criteria, false, '', '', '', false, 'OR') as $contact) $filters = array(null);
// if accounts-backend is NOT SQL, we need to search the accounts separate
if ($this->so_accounts)
{
$filters[] = array('owner' => '0');
}
foreach($filters as $filter)
{
foreach((array)$this->search($criteria, false, '', '', '', false, 'OR', false, $filter) as $contact)
{ {
if ($contact['account_id'] && isset($keys[$contact['account_id']])) if ($contact['account_id'] && isset($keys[$contact['account_id']]))
{ {
@ -267,6 +275,7 @@ class addressbook_bo extends Api\Contacts
} }
} }
} }
}
if ($criteria == array('egw.addressbook.account_id' => array((int)$GLOBALS['egw_info']['user']['account_id']))) if ($criteria == array('egw.addressbook.account_id' => array((int)$GLOBALS['egw_info']['user']['account_id'])))
{ {
$message = !$updated ? lang('Permissiong denied! Ask your administrator to allow regular uses to update their public keys.') : $message = !$updated ? lang('Permissiong denied! Ask your administrator to allow regular uses to update their public keys.') :