From: Marcel Werk Date: Tue, 19 Jul 2016 22:33:16 +0000 (+0200) Subject: Improved e-mail reactivation form X-Git-Tag: 3.0.0_Beta_1~1037 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c43d8028d21f0eddcff346b59d2ce287a3fc2da;p=GitHub%2FWoltLab%2FWCF.git Improved e-mail reactivation form --- 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();