diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-04-11 10:27:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 10:27:59 +0200 |
commit | cde260577e90dc7f3aea1d610ae6c2b93e949af5 (patch) | |
tree | ab46a2129ace4a8046d604fe675c657c653aad6a /lib | |
parent | e36233dbab7995c4b2e037828ccb168005e5d76f (diff) | |
parent | 0e06ee68c0af2a953a5b32865c48a8bdfa6396b3 (diff) | |
download | nextcloud-server-cde260577e90dc7f3aea1d610ae6c2b93e949af5.tar.gz nextcloud-server-cde260577e90dc7f3aea1d610ae6c2b93e949af5.zip |
Merge pull request #31857 from nextcloud/feat/dont_match_userid
Add settings to not match userID during full match
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Collaborators/UserPlugin.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index 1c00bb26c94..4d8bc4cbf3a 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -54,6 +54,8 @@ class UserPlugin implements ISearchPlugin { protected $shareeEnumerationPhone; /* @var bool */ protected $shareeEnumerationFullMatch; + /* @var bool */ + protected $shareeEnumerationFullMatchUserId; /** @var IConfig */ private $config; @@ -87,6 +89,7 @@ class UserPlugin implements ISearchPlugin { $this->shareeEnumerationInGroupOnly = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes'; $this->shareeEnumerationPhone = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_phone', 'no') === 'yes'; $this->shareeEnumerationFullMatch = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match', 'yes') === 'yes'; + $this->shareeEnumerationFullMatchUserId = $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_full_match_userid', 'yes') === 'yes'; } public function search($search, $limit, $offset, ISearchResult $searchResult) { @@ -228,7 +231,7 @@ class UserPlugin implements ISearchPlugin { } } - if ($this->shareeEnumerationFullMatch && $offset === 0 && !$foundUserById) { + if ($this->shareeEnumerationFullMatch && $this->shareeEnumerationFullMatchUserId && $offset === 0 && !$foundUserById) { // On page one we try if the search result has a direct hit on the // user id and if so, we add that to the exact match list $user = $this->userManager->get($search); |