aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-30 00:26:23 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2021-06-30 00:48:05 +0200
commita0752543d843fc438c03b0c72e3872c9ea1175e1 (patch)
tree88d6716f0a38b9763e5172731cea525153de9554
parent00ffad3c6065bc34bc4bde1a80f1a33658da3094 (diff)
downloadnextcloud-server-a0752543d843fc438c03b0c72e3872c9ea1175e1.tar.gz
nextcloud-server-a0752543d843fc438c03b0c72e3872c9ea1175e1.zip
fix small issues in UsersController handling
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/provisioning_api/lib/Controller/AUserData.php2
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php8
-rw-r--r--build/integration/features/bootstrap/Provisioning.php3
3 files changed, 7 insertions, 6 deletions
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);
}
diff --git a/build/integration/features/bootstrap/Provisioning.php b/build/integration/features/bootstrap/Provisioning.php
index ad22925eddf..e51339c081e 100644
--- a/build/integration/features/bootstrap/Provisioning.php
+++ b/build/integration/features/bootstrap/Provisioning.php
@@ -168,9 +168,6 @@ trait Provisioning {
$response = $client->get($fullUrl, $options);
foreach ($settings->getRows() as $setting) {
$value = json_decode(json_encode(simplexml_load_string($response->getBody())->data->{$setting[0]}), 1);
- if (in_array($setting[0], ['additional_mail', 'additional_mailScope'], true)) {
- var_dump($value);
- }
if (isset($value['element']) && in_array($setting[0], ['additional_mail', 'additional_mailScope'], true)) {
$expectedValues = explode(';', $setting[1]);
foreach ($expectedValues as $expected) {