Event added for changing variable $registerVia3rdParty in wcf\form\RegisterForm
authorPeter Lohse <peterlohse@yahoo.de>
Fri, 31 Jan 2020 12:42:29 +0000 (13:42 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 25 May 2020 11:48:28 +0000 (13:48 +0200)
Closes #3143

[Tim: Made the changes requested in #3143]

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

index bd8af469f5f149bcdd86eda063c95f826251e01c..5a64e1a09200d6c1409f2b07edb2a097edb4826e 100644 (file)
@@ -17,6 +17,7 @@ use wcf\system\email\mime\RecipientAwareTextMimePart;
 use wcf\system\email\Email;
 use wcf\system\email\Mailbox;
 use wcf\system\email\UserMailbox;
+use wcf\system\event\EventHandler;
 use wcf\system\exception\NamedUserException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\SystemException;
@@ -423,6 +424,14 @@ class RegisterForm extends UserAddForm {
                        // create fake password
                        $this->password = bin2hex(\random_bytes(20));
                }
+
+               $eventParameters = [
+                       'saveOptions' => $saveOptions,
+                       'registerVia3rdParty' => $registerVia3rdParty,
+               ];
+               EventHandler::getInstance()->fireAction($this, 'registerVia3rdParty', $eventParameters);
+               $saveOptions = $eventParameters['saveOptions'];
+               $registerVia3rdParty = $eventParameters['registerVia3rdParty'];
                
                $this->additionalFields['languageID'] = $this->languageID;
                if (LOG_IP_ADDRESS) $this->additionalFields['registrationIpAddress'] = WCF::getSession()->ipAddress;