Implements attribute active.
This commit is contained in:
parent
ace615aa97
commit
d369661b8c
2 changed files with 9 additions and 3 deletions
|
@ -88,6 +88,8 @@ abstract class ASCIMUser extends ApiController {
|
||||||
throw new SCIMException('User not found', 404);
|
throw new SCIMException('User not found', 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$enabled = $this->config->getUserValue($targetUserObject->getUID(), 'core', 'enabled', 'true') === 'true';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'schemas' => ["urn:ietf:params:scim:schemas:core:2.0:User"],
|
'schemas' => ["urn:ietf:params:scim:schemas:core:2.0:User"],
|
||||||
'id' => $userId,
|
'id' => $userId,
|
||||||
|
@ -106,7 +108,7 @@ abstract class ASCIMUser extends ApiController {
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
//'groups' => [],
|
//'groups' => [],
|
||||||
'active' => (bool) $this->config->getUserValue($userId, 'core', 'enabled', 'true') === 'true'
|
'active' => $enabled
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,7 @@ class UserController extends ASCIMUser {
|
||||||
$newUser->setEMailAddress($email['value']);
|
$newUser->setEMailAddress($email['value']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$newUser->setEnabled($active);
|
||||||
return new SCIMResourceResponse($this->getSCIMUser($userName));
|
return new SCIMResourceResponse($this->getSCIMUser($userName));
|
||||||
} catch (SCIMException $e) {
|
} catch (SCIMException $e) {
|
||||||
$this->logger->warning('Failed createUser attempt with SCIMException exeption.', ['app' => 'SCIMServiceProvider']);
|
$this->logger->warning('Failed createUser attempt with SCIMException exeption.', ['app' => 'SCIMServiceProvider']);
|
||||||
|
@ -207,6 +208,9 @@ class UserController extends ASCIMUser {
|
||||||
$targetUser->setEMailAddress($email['value']);
|
$targetUser->setEMailAddress($email['value']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isset($active)) {
|
||||||
|
$targetUser->setEnabled($active);
|
||||||
|
}
|
||||||
return new SCIMResourceResponse($this->getSCIMUser($id));
|
return new SCIMResourceResponse($this->getSCIMUser($id));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue