From 4bc0dddf9247014c8d44bcc5f151c2b4ca7fed09 Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Thu, 18 Jun 2020 10:48:40 +0200 Subject: [PATCH] Confirm email addresses on enabling users only, if the user cannot confirm the email by theirself --- .../files/lib/data/user/UserAction.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index cda50c2615..a0c4abf00d 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -679,12 +679,17 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio public function enable() { if (empty($this->objects)) $this->readObjects(); + $data = [ + 'activationCode' => 0, + 'blacklistMatches' => '', + ]; + + if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) { + $data['emailConfirmed'] = null; + } + $action = new UserAction($this->objects, 'update', [ - 'data' => [ - 'activationCode' => 0, - 'blacklistMatches' => '', - 'emailConfirmed' => null, - ], + 'data' => $data, 'removeGroups' => UserGroup::getGroupIDsByType([UserGroup::GUESTS]) ]); $action->executeAction(); -- 2.20.1