From: Marcel Werk Date: Wed, 24 Jul 2024 14:41:48 +0000 (+0200) Subject: Remove email activation process after registration via third-party X-Git-Tag: 6.1.0_Alpha_1~4^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6b9a140dd8d33530334d6915be2a5e42afb8471;p=GitHub%2FWoltLab%2FWCF.git Remove email activation process after registration via third-party ref https://www.woltlab.com/community/thread/307268-benutzeraktivierung-bei-google-nutzung/ --- diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index a04020db59..5d22eccd31 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -410,9 +410,11 @@ class RegisterForm extends UserAddForm || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) ) { $activationCode = UserRegistrationUtil::getActivationCode(); - $emailConfirmCode = Hex::encode(\random_bytes(20)); $this->additionalFields['activationCode'] = $activationCode; - $this->additionalFields['emailConfirmed'] = $emailConfirmCode; + if (!$registerVia3rdParty) { + $emailConfirmCode = Hex::encode(\random_bytes(20)); + $this->additionalFields['emailConfirmed'] = $emailConfirmCode; + } $addDefaultGroups = false; $this->groupIDs = UserGroup::getGroupIDsByType([UserGroup::EVERYONE, UserGroup::GUESTS]); } @@ -447,7 +449,11 @@ class RegisterForm extends UserAddForm } elseif (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && empty($this->blacklistMatches)) { // registering via 3rdParty leads to instant activation if ($registerVia3rdParty) { - $this->message = 'wcf.user.register.success'; + if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) { + $this->message = 'wcf.user.register.success.awaitActivation'; + } else { + $this->message = 'wcf.user.register.success'; + } } else { $email = new Email(); $email->addRecipient(new UserMailbox(WCF::getUser()));