Confirm email addresses on enabling users only, if the user cannot confirm the email...
authorjoshuaruesweg <ruesweg@woltlab.com>
Thu, 18 Jun 2020 08:48:40 +0000 (10:48 +0200)
committerjoshuaruesweg <ruesweg@woltlab.com>
Thu, 18 Jun 2020 08:48:40 +0000 (10:48 +0200)
wcfsetup/install/files/lib/data/user/UserAction.class.php

index cda50c2615fc768d048b945789a0b8326ebfcb2d..a0c4abf00d99097499e4b0bb7635c27b78199b70 100644 (file)
@@ -679,12 +679,17 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
        public function enable() {
                if (empty($this->objects)) $this->readObjects();
                
+               $data = [
+                       'activationCode' => 0,
+                       'blacklistMatches' => '',
+               ];
+               
+               if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
+                       $data['emailConfirmed'] = null;
+               }
+               
                $action = new UserAction($this->objects, 'update', [
-                       'data' => [
-                               'activationCode' => 0,
-                               'blacklistMatches' => '',
-                               'emailConfirmed' => null,
-                       ],
+                       'data' => $data,
                        'removeGroups' => UserGroup::getGroupIDsByType([UserGroup::GUESTS])
                ]);
                $action->executeAction();