Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-03-12 11:04:13 +0300
committerJoas Schilling <coding@schilljs.com>2021-03-12 11:04:13 +0300
commit5c3551cf2f57b2ce72f2503e731f10cec5355782 (patch)
tree2afc5dce253caefd12a2ce7d0bf3a3c260dd4cd6 /apps/provisioning_api
parent56b08c04c739dc5ad1cc0e924004fa8acc2ce3ac (diff)
Only clear known users when we had at least one phonebook entry
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index 579f9ae522a..d2f9b9e91c2 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -240,9 +240,6 @@ class UsersController extends AUserData {
$user = $this->userSession->getUser();
$knownTo = $user->getUID();
- // Cleanup all previous entries and only allow new matches
- $this->knownUserService->deleteKnownTo($knownTo);
-
$normalizedNumberToKey = [];
foreach ($search as $key => $phoneNumbers) {
foreach ($phoneNumbers as $phone) {
@@ -263,6 +260,9 @@ class UsersController extends AUserData {
return new DataResponse();
}
+ // Cleanup all previous entries and only allow new matches
+ $this->knownUserService->deleteKnownTo($knownTo);
+
$userMatches = $this->accountManager->searchUsers(IAccountManager::PROPERTY_PHONE, $phoneNumbers);
if (empty($userMatches)) {