Set email confirmation status on email activation
authorjoshuaruesweg <ruesweg@woltlab.com>
Wed, 3 Jun 2020 19:59:58 +0000 (21:59 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Wed, 3 Jun 2020 19:59:58 +0000 (21:59 +0200)
wcfsetup/install/files/lib/form/EmailActivationForm.class.php

index b05d1e8691f6e3bb00bc857527c9065dd6c7f207..ee902b68f761ac3cb57fcbcd3505946176be5afb 100644 (file)
@@ -97,9 +97,12 @@ class EmailActivationForm extends AbstractForm {
                        'newEmail' => '',
                        'reactivationCode' => 0
                ];
-               if ($this->user->activationCode != 0 && REGISTER_ACTIVATION_METHOD & 1) {
-                       // @TODO
-                       $data['activationCode'] = 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