Filter contacts from the local system addressbook - remote share with local users is not allowed

This commit is contained in:
Thomas Müller 2016-02-02 11:24:26 +01:00
parent 22de25c382
commit dfb88612af
2 changed files with 7 additions and 0 deletions

View File

@ -214,6 +214,10 @@ class AddressBookImpl implements IAddressBook {
foreach ($vCard->children as $property) {
$result[$property->name] = $property->getValue();
}
if ($this->addressBookInfo['principaluri'] === 'principals/system/system' &&
$this->addressBookInfo['uri'] === 'system') {
$result['isLocalSystemBook'] = true;
}
return $result;
}
}

View File

@ -270,6 +270,9 @@ class Sharees {
$addressBookContacts = $this->contactsManager->search($search, ['CLOUD', 'FN']);
$foundRemoteById = false;
foreach ($addressBookContacts as $contact) {
if (isset($contact['isLocalSystemBook'])) {
continue;
}
if (isset($contact['CLOUD'])) {
$cloudIds = $contact['CLOUD'];
if (!is_array($cloudIds)) {