From a0752543d843fc438c03b0c72e3872c9ea1175e1 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 30 Jun 2021 00:26:23 +0200 Subject: fix small issues in UsersController handling Signed-off-by: Arthur Schiwon --- apps/provisioning_api/lib/Controller/AUserData.php | 2 +- apps/provisioning_api/lib/Controller/UsersController.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'apps/provisioning_api') diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 8069fcb4da5..e358d282061 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -156,7 +156,7 @@ abstract class AUserData extends OCSController { foreach ($emailCollection->getProperties() as $property) { $additionalEmails[] = $property->getValue(); if ($includeScopes) { - $additionalEmailScopes = $property->getScope(); + $additionalEmailScopes[] = $property->getScope(); } } $data[IAccountManager::COLLECTION_EMAIL] = $additionalEmails; diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index f5993e3aa5c..b81801aba28 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -673,8 +673,12 @@ class UsersController extends AUserData { } } if ($targetProperty instanceof IAccountProperty) { - $targetProperty->setScope($value); - $this->accountManager->updateAccount($userAccount); + try { + $targetProperty->setScope($value); + $this->accountManager->updateAccount($userAccount); + } catch (\InvalidArgumentException $e) { + throw new OCSException('', 102); + } } else { throw new OCSException('', 102); } -- cgit v1.2.3