Fix EmailNewActivationCodeForm
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 14 Oct 2021 13:10:10 +0000 (15:10 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 14 Oct 2021 13:10:10 +0000 (15:10 +0200)
This got broken, because it inherits from RegisterNewActivationForm and the “is
already enabled” validation was moved into a dedicated method within there. This
is a perfect example of why one should never inherit from controllers …

see f394421c0cc7e8879007092e40e540b2fd1118c1

wcfsetup/install/files/lib/form/EmailNewActivationCodeForm.class.php

index 808a700d89bb7de482bea1751652138222109d56..a96b12882db7011a1a62b57b2e683b17fe2d4540 100644 (file)
@@ -45,7 +45,13 @@ class EmailNewActivationCodeForm extends RegisterNewActivationCodeForm {
                if (!$this->user->userID) {
                        throw new UserInputException('username', 'notFound');
                }
-               
+       }
+
+       /**
+        * @inheritDoc
+        */
+       public function validateActivationState() {
+               // check if user is already enabled
                if ($this->user->reactivationCode == 0) {
                        throw new UserInputException('username', 'alreadyEnabled');
                }