diff --git a/addressbook/inc/class.addressbook_sif.inc.php b/addressbook/inc/class.addressbook_sif.inc.php index 8ad5a9e4bd..fc451406ca 100644 --- a/addressbook/inc/class.addressbook_sif.inc.php +++ b/addressbook/inc/class.addressbook_sif.inc.php @@ -238,13 +238,15 @@ class addressbook_sif extends addressbook_bo $contact['id'] = $_abID; } elseif (array_key_exists('filter_addressbook', $GLOBALS['egw_info']['user']['preferences']['syncml'])) - { - $contact['owner'] = (int) $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']; - if ($contact['owner'] == -1) - { - $contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group']; - } - } + { + $contact['owner'] = (int) $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']; + if ($contact['owner'] == -1) + { + $contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group']; + } + // if there is a positive id as filter it is to be interpreted as "Personal Addressbook" + if ($contact['owner'] > 0) $contact['owner'] = $GLOBALS['egw_info']['user']['account_id']; + } return $this->save($contact); } diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index 05a0d31b6f..91f82607f4 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -166,6 +166,8 @@ class addressbook_vcal extends addressbook_bo { $contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group']; } + // if there is a positive id as filter it is to be interpreted as "Personal Addressbook" + if ($contact['owner'] > 0) $contact['owner'] = $GLOBALS['egw_info']['user']['account_id']; if (is_array($contact['category'])) { $contact['category'] = implode(',',$this->find_or_add_categories($contact['category'], -1)); @@ -931,7 +933,14 @@ class addressbook_vcal extends addressbook_bo if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook'])) { - $contact['owner'] = $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']; + //$contact['owner'] = $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']; + $contact['owner'] = (int) $GLOBALS['egw_info']['user']['preferences']['syncml']['filter_addressbook']; + if ($contact['owner'] == -1) + { + $contact['owner'] = $GLOBALS['egw_info']['user']['account_primary_group']; + } + // if there is a positive id as filter it is to be interpreted as "Personal Addressbook" + if ($contact['owner'] > 0) $contact['owner'] = $GLOBALS['egw_info']['user']['account_id']; } $this->fixup_contact($contact);