Implements attribute active.

This commit is contained in:
Pierre Ozoux 2022-04-29 18:03:57 +02:00
parent ace615aa97
commit d369661b8c
2 changed files with 9 additions and 3 deletions

View file

@ -88,6 +88,8 @@ abstract class ASCIMUser extends ApiController {
throw new SCIMException('User not found', 404);
}
$enabled = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true';
return [
'schemas' => ["urn:ietf:params:scim:schemas:core:2.0:User"],
'id' => $userId,
@ -106,7 +108,7 @@ abstract class ASCIMUser extends ApiController {
]
],
//'groups' => [],
'active' => (bool) $this->config->getUserValue($userId, 'core', 'enabled', 'true') === 'true'
'active' => $enabled
];
}

View file

@ -175,6 +175,7 @@ class UserController extends ASCIMUser {
$newUser->setEMailAddress($email['value']);
}
}
$newUser->setEnabled($active);
return new SCIMResourceResponse($this->getSCIMUser($userName));
} catch (SCIMException $e) {
$this->logger->warning('Failed createUser attempt with SCIMException exeption.', ['app' => 'SCIMServiceProvider']);
@ -207,6 +208,9 @@ class UserController extends ASCIMUser {
$targetUser->setEMailAddress($email['value']);
}
}
if (isset($active)) {
$targetUser->setEnabled($active);
}
return new SCIMResourceResponse($this->getSCIMUser($id));
}