From 06386d07d7da10fe077da49b87279b2d6475b8df Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Thu, 18 Jun 2020 10:43:29 +0200 Subject: [PATCH] Enable user if he confirms a new email --- .../files/lib/form/EmailActivationForm.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php index ee902b68f7..17b31bbd6b 100644 --- a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php +++ b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php @@ -97,19 +97,20 @@ class EmailActivationForm extends AbstractForm { 'newEmail' => '', 'reactivationCode' => 0 ]; - if (!$this->user->isEmailConfirmed() && (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) { - $data['emailConfirmed'] = null; - - if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN)) { - $data['activationCode'] = 0; - } - } // enable new email $this->objectAction = new UserAction([$this->user], 'update', [ 'data' => array_merge($this->additionalFields, $data) ]); $this->objectAction->executeAction(); + + // confirm email + if (!$this->user->isEmailConfirmed() && empty($this->user->blacklistMatches)) { + // enable new email + $this->objectAction = new UserAction([$this->user], 'confirmEmail'); + $this->objectAction->executeAction(); + } + $this->saved(); // forward to index page -- 2.20.1