]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix small issues in UsersController handling
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 29 Jun 2021 22:26:23 +0000 (00:26 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 29 Jun 2021 22:48:05 +0000 (00:48 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/provisioning_api/lib/Controller/AUserData.php
apps/provisioning_api/lib/Controller/UsersController.php
build/integration/features/bootstrap/Provisioning.php

index 8069fcb4da52a7b6992d2b2601cacf7f65c4562e..e358d2820618699b14af0be905754b39d76f4187 100644 (file)
@@ -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;
index f5993e3aa5c0372b60ff1fe4de8eaaffe5c2bcbd..b81801aba285af48c6d54d12b2f0f9db447eefae 100644 (file)
@@ -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);
                                }
index ad22925eddffecc28f4dba0f5457094b2a5b4408..e51339c081e02219755015f85217c544c2104006 100644 (file)
@@ -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) {