From e2c4d57f8006ff6066619d044b282cdee0d329e4 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sat, 31 Jul 2021 23:28:14 +0000 Subject: [PATCH] Add ability to set email confirmation state to false [ci skip] [skip ci] --- src/User/Command/EditUserHandler.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/User/Command/EditUserHandler.php b/src/User/Command/EditUserHandler.php index 51cdd6264c..17423f53c2 100644 --- a/src/User/Command/EditUserHandler.php +++ b/src/User/Command/EditUserHandler.php @@ -82,9 +82,14 @@ public function handle(EditUser $command) } } - if (! empty($attributes['isEmailConfirmed'])) { + if (isset($attributes['isEmailConfirmed'])) { $actor->assertAdmin(); - $user->activate(); + + if ($attributes['isEmailConfirmed'] === false) { + $user->is_email_confirmed = false; + } else { + $user->activate(); + } } if (isset($attributes['password'])) {