fix small issues in UsersController handling

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-06-30 00:26:23 +02:00
Родитель 00ffad3c60
Коммит a0752543d8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7424F1874854DF23
3 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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) {