diff options
author | Tobia De Koninck <tobia@ledfan.be> | 2017-08-14 11:45:54 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-09-15 14:31:41 +0200 |
commit | 5896176d69d00843cbe4b2acfb45beaa1de76530 (patch) | |
tree | 3c45d188c3fb6a4d867fd8d75621d96f465e84a2 /lib/private/Contacts | |
parent | 7dfa527da2899d02353ff1ae1aa8cc00371bb628 (diff) | |
download | nextcloud-server-5896176d69d00843cbe4b2acfb45beaa1de76530.tar.gz nextcloud-server-5896176d69d00843cbe4b2acfb45beaa1de76530.zip |
Fix issue when disabling the shareapi_only_share_with_group_members option + fix findOne
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
Diffstat (limited to 'lib/private/Contacts')
-rw-r--r-- | lib/private/Contacts/ContactsMenu/ContactsStore.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 299e88ad01b..87aff258aae 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -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; } /** |