Improved e-mail reactivation form
authorMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 22:33:16 +0000 (00:33 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 19 Jul 2016 22:33:16 +0000 (00:33 +0200)
com.woltlab.wcf/templates/accountManagement.tpl
wcfsetup/install/files/lib/form/EmailActivationForm.class.php

index 858b66059ed41ea96a18a4b7776a1d13a79d272b..f44370aea943c3639dd0133c04b853d5450aa507 100644 (file)
                                <dl>
                                        <dt></dt>
                                        <dd>
-                                               <ul class="buttonList smallButtons">
-                                                       <li><a class="button small" href="{link controller='EmailActivation'}{/link}"><span>{lang}wcf.user.emailActivation{/lang}</span></a></li>
-                                               </ul>
                                                <small>{lang newEmail=$__wcf->user->email}wcf.user.changeEmail.needReactivation{/lang}</small>
+                                               <small><a href="{link controller='EmailActivation'}{/link}"><span>{lang}wcf.user.emailActivation{/lang}</span></a></small>
                                        </dd>
                                </dl>
                        {/if}
index 7924556ab16652165330edfd471373bca5eaf63d..f39f41a1a9b4051593671f82dd662093de3d81e0 100644 (file)
@@ -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();