Fix issue when disabling the shareapi_only_share_with_group_members option + fix findOne

Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
This commit is contained in:
Tobia De Koninck 2017-08-14 11:45:54 +02:00 committed by Lukas Reschke
parent 7dfa527da2
commit 5896176d69
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 12 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class ContactsStore {
// whether to filter out local users
$skipLocal = false;
// whether to filter out all users which doesn't have the same group as the current user
$ownGroupsOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no');
$ownGroupsOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
$selfGroups = $this->groupManager->getUserGroupIds($self);
@ -172,7 +172,17 @@ class ContactsStore {
}
}
return $match ? $this->contactArrayToEntry($match) : null;
if ($match) {
$match = $this->filterContacts($user, [$this->contactArrayToEntry($match)]);
if (count($match) === 1) {
$match = $match[0];
} else {
$match = null;
}
}
return $match;
}
/**