mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
further fix for "private contacts got not synced" issue, r31918 was not working, because filter[owner] was an array
This commit is contained in:
parent
f4fa73412b
commit
dc88857d9e
@ -278,8 +278,18 @@ class addressbook_sql extends so_sql_cf
|
|||||||
{
|
{
|
||||||
if (!($filter['owner'] = array_intersect((array)$filter['owner'],array_keys($this->grants)))) return false;
|
if (!($filter['owner'] = array_intersect((array)$filter['owner'],array_keys($this->grants)))) return false;
|
||||||
|
|
||||||
// for an owner filter, which is NOT the current user, filter out private entries
|
// for an owner filter, which does NOT include current user, filter out private entries
|
||||||
if ($filter['owner'] != $GLOBALS['egw_info']['user']['account_id']) $filter['private'] = 0;
|
if (!in_array($GLOBALS['egw_info']['user']['account_id'],$filter['owner']))
|
||||||
|
{
|
||||||
|
$filter['private'] = 0;
|
||||||
|
}
|
||||||
|
// if multiple addressbooks (incl. current owner) are searched, we need full acl filter
|
||||||
|
elseif(count($filter['owner']) > 1)
|
||||||
|
{
|
||||||
|
$filter[] = "($this->table_name.contact_owner=".(int)$GLOBALS['egw_info']['user']['account_id'].
|
||||||
|
" OR contact_private=0 AND $this->table_name.contact_owner IN (".
|
||||||
|
implode(',',array_keys($this->grants)).") OR $this->table_name.contact_owner IS NULL)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // search all addressbooks, incl. accounts
|
else // search all addressbooks, incl. accounts
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user