diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-12 09:04:13 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-03-12 09:04:13 +0100 |
commit | 5c3551cf2f57b2ce72f2503e731f10cec5355782 (patch) | |
tree | 2afc5dce253caefd12a2ce7d0bf3a3c260dd4cd6 /apps/provisioning_api | |
parent | 56b08c04c739dc5ad1cc0e924004fa8acc2ce3ac (diff) | |
download | nextcloud-server-5c3551cf2f57b2ce72f2503e731f10cec5355782.tar.gz nextcloud-server-5c3551cf2f57b2ce72f2503e731f10cec5355782.zip |
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.php | 6 |
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)) { |