utilize UserService for SAML (#4748)
This commit is contained in:
@@ -50,7 +50,7 @@ final class ActivateUserCommand extends Command
|
||||
|
||||
if (!$user->isEnabled()) {
|
||||
$user->setEnabled(true);
|
||||
$this->userService->updateUser($user);
|
||||
$this->userService->saveUser($user);
|
||||
$io->success(sprintf('User "%s" has been activated.', $username));
|
||||
} else {
|
||||
$io->warning(sprintf('User "%s" is already active.', $username));
|
||||
|
||||
@@ -76,7 +76,7 @@ final class CreateUserCommand extends AbstractUserCommand
|
||||
}
|
||||
|
||||
try {
|
||||
$this->userService->saveNewUser($user);
|
||||
$this->userService->saveUser($user);
|
||||
$io->success(sprintf('Success! Created user: %s', $username));
|
||||
} catch (ValidationFailedException $ex) {
|
||||
$this->validationError($ex, $io);
|
||||
|
||||
@@ -50,7 +50,7 @@ final class DeactivateUserCommand extends Command
|
||||
|
||||
if ($user->isEnabled()) {
|
||||
$user->setEnabled(false);
|
||||
$this->userService->updateUser($user);
|
||||
$this->userService->saveUser($user);
|
||||
$io->success(sprintf('User "%s" has been deactivated.', $username));
|
||||
} else {
|
||||
$io->warning(sprintf('User "%s" is already deactivated.', $username));
|
||||
|
||||
@@ -39,7 +39,7 @@ final class DemoteUserCommand extends AbstractRoleCommand
|
||||
if ($super) {
|
||||
if ($user->isSuperAdmin()) {
|
||||
$user->setSuperAdmin(false);
|
||||
$manipulator->updateUser($user);
|
||||
$manipulator->saveUser($user);
|
||||
$output->success(sprintf('Super administrator role has been removed from the user "%s".', $username));
|
||||
} else {
|
||||
$output->warning(sprintf('User "%s" doesn\'t have the super administrator role.', $username));
|
||||
@@ -47,7 +47,7 @@ final class DemoteUserCommand extends AbstractRoleCommand
|
||||
} else {
|
||||
if ($user->hasRole($role)) {
|
||||
$user->removeRole($role);
|
||||
$manipulator->updateUser($user);
|
||||
$manipulator->saveUser($user);
|
||||
$output->success(sprintf('Role "%s" has been removed from user "%s".', $role, $username));
|
||||
} else {
|
||||
$output->warning(sprintf('User "%s" didn\'t have "%s" role.', $username, $role));
|
||||
|
||||
@@ -39,7 +39,7 @@ final class PromoteUserCommand extends AbstractRoleCommand
|
||||
if ($super) {
|
||||
if (!$user->isSuperAdmin()) {
|
||||
$user->setSuperAdmin(true);
|
||||
$manipulator->updateUser($user);
|
||||
$manipulator->saveUser($user);
|
||||
$output->success(sprintf('User "%s" has been promoted as a super administrator.', $username));
|
||||
} else {
|
||||
$output->warning(sprintf('User "%s" does already have the super administrator role.', $username));
|
||||
@@ -47,7 +47,7 @@ final class PromoteUserCommand extends AbstractRoleCommand
|
||||
} else {
|
||||
if (!$user->hasRole($role)) {
|
||||
$user->addRole($role);
|
||||
$manipulator->updateUser($user);
|
||||
$manipulator->saveUser($user);
|
||||
$output->success(sprintf('Role "%s" has been added to user "%s".', $role, $username));
|
||||
} else {
|
||||
$output->warning(sprintf('User "%s" did already have "%s" role.', $username, $role));
|
||||
|
||||
Reference in New Issue
Block a user