From 55a5d26c562c5221c93f191532372cc8fde76adb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 Mar 2021 20:32:50 +0100 Subject: Delete matches when a user changes their phone number Signed-off-by: Joas Schilling --- apps/provisioning_api/lib/Controller/UsersController.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/provisioning_api') diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 9cc8372daa4..648faf8ad20 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -699,6 +699,10 @@ class UsersController extends AUserData { $userAccount[$key]['value'] = $value; try { $this->accountManager->updateUser($targetUser, $userAccount, true); + + if ($key === IAccountManager::PROPERTY_PHONE) { + $this->knownUserMapper->deleteKnownUser($targetUser->getUID()); + } } catch (\InvalidArgumentException $e) { throw new OCSException('Invalid ' . $e->getMessage(), 102); } -- cgit v1.2.3