From 8c43d8028d21f0eddcff346b59d2ce287a3fc2da Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 20 Jul 2016 00:33:16 +0200 Subject: [PATCH] Improved e-mail reactivation form --- com.woltlab.wcf/templates/accountManagement.tpl | 4 +--- .../files/lib/form/EmailActivationForm.class.php | 15 ++++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/com.woltlab.wcf/templates/accountManagement.tpl b/com.woltlab.wcf/templates/accountManagement.tpl index 858b66059e..f44370aea9 100644 --- a/com.woltlab.wcf/templates/accountManagement.tpl +++ b/com.woltlab.wcf/templates/accountManagement.tpl @@ -141,10 +141,8 @@
- {lang newEmail=$__wcf->user->email}wcf.user.changeEmail.needReactivation{/lang} + {lang}wcf.user.emailActivation{/lang}
{/if} diff --git a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php index 7924556ab1..f39f41a1a9 100644 --- a/wcfsetup/install/files/lib/form/EmailActivationForm.class.php +++ b/wcfsetup/install/files/lib/form/EmailActivationForm.class.php @@ -92,13 +92,18 @@ class EmailActivationForm extends AbstractForm { public function save() { parent::save(); + $data = [ + 'email' => $this->user->newEmail, + 'newEmail' => '', + 'reactivationCode' => 0 + ]; + if ($this->user->activationCode != 0 && REGISTER_ACTIVATION_METHOD == 1) { + $data['activationCode'] = 0; + } + // enable new email $this->objectAction = new UserAction([$this->user], 'update', [ - 'data' => array_merge($this->additionalFields, [ - 'email' => $this->user->newEmail, - 'newEmail' => '', - 'reactivationCode' => 0 - ]) + 'data' => array_merge($this->additionalFields, $data) ]); $this->objectAction->executeAction(); $this->saved(); -- 2.20.1