Skip to content

Commit

Permalink
fix small issues in UsersController handling
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Jun 29, 2021
1 parent 8d3fb41 commit ff99a05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/provisioning_api/lib/Controller/AUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function getUserData(string $userId, bool $includeScopes = false): arr
foreach ($emailCollection->getProperties() as $property) {
$additionalEmails[] = $property->getValue();
if ($includeScopes) {
$additionalEmailScopes = $property->getScope();
$additionalEmailScopes[] = $property->getScope();
}
}
$data[IAccountManager::COLLECTION_EMAIL] = $additionalEmails;
Expand Down
8 changes: 6 additions & 2 deletions apps/provisioning_api/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,12 @@ public function editUserMultiValue(
}
}
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);
}
Expand Down
3 changes: 0 additions & 3 deletions build/integration/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,6 @@ public function userHasSetting($user, $settings) {
$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) {
Expand Down

0 comments on commit ff99a05

Please sign in to comment.