Improve condition readability
authorJoshua Rüsweg <ruesweg@woltlab.com>
Wed, 3 Jun 2020 15:01:49 +0000 (17:01 +0200)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 15:01:49 +0000 (17:01 +0200)
Co-authored-by: Tim Düsterhus <duesterhus@woltlab.com>
wcfsetup/install/files/lib/form/EmailActivationForm.class.php
wcfsetup/install/files/lib/form/RegisterActivationForm.class.php
wcfsetup/install/files/lib/form/RegisterForm.class.php

index 4b7c079439709af2ef11b6f6c4dcdc0d2f561ce3..b05d1e8691f6e3bb00bc857527c9065dd6c7f207 100644 (file)
@@ -130,7 +130,7 @@ class EmailActivationForm extends AbstractForm {
         * @inheritDoc
         */
        public function show() {
-               if (!(REGISTER_ACTIVATION_METHOD & 1)) {
+               if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
                        throw new IllegalLinkException();
                }
                
index be803ec619b5f315afa29bfd21061b85abb84468..1e301270c6e4a88078b1814fb6c48598713e7a5d 100644 (file)
@@ -104,7 +104,7 @@ class RegisterActivationForm extends AbstractForm {
                $this->saved();
                
                // forward to index page
-               if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN && !$this->user->isActivated()) {
+               if ((REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) && !$this->user->isActivated()) {
                        $redirectText = WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success.awaitAdminActivation');
                }
                else {
index ded41b4346b8cfc448acfa74fff7b835edb718bd..62782b5ecf26c9205e15a60d5e9f0053ba79ce6d 100644 (file)
@@ -429,7 +429,7 @@ class RegisterForm extends UserAddForm {
                
                // generate activation code
                $addDefaultGroups = true;
-               if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) {
+               if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN)) {
                        $activationCode = UserRegistrationUtil::getActivationCode();
                        $emailConfirmCode = bin2hex(\random_bytes(20));
                        $this->additionalFields['activationCode'] = $activationCode;