Fixed user enable/disable function
authorMarcel Werk <burntime@woltlab.com>
Sun, 2 Jun 2013 15:06:47 +0000 (17:06 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 2 Jun 2013 15:06:47 +0000 (17:06 +0200)
wcfsetup/install/files/lib/data/user/UserAction.class.php

index fe83e8ed382221dd2d30f6943075bfc710d0d77d..65ca6bcc774cc378243a1d5b7051e0accc1b2b7c 100644 (file)
@@ -454,22 +454,14 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        'data' => array(
                                'activationCode' => 0
                        ),
-                       'groups' => array(
-                               UserGroup::USERS
-                       ),
-                       'removeGroups' => array(
-                               UserGroup::GUESTS
-                       )
+                       'removeGroups' => UserGroup::getGroupIDsByType(array(UserGroup::GUESTS))
                ));
                $action->executeAction();
-       
-               // update user rank
-               if (MODULE_USER_RANK) {
-                       $action = new UserProfileAction($this->objects, 'updateUserRank');
-                       $action->executeAction();
-               }
-               // update user online marking
-               $action = new UserProfileAction($this->objects, 'updateUserOnlineMarking');
+               $action = new UserAction($this->objects, 'addToGroups', array(
+                       'groups' => UserGroup::getGroupIDsByType(array(UserGroup::USERS)),
+                       'deleteOldGroups' => false,
+                       'addDefaultGroups' => false     
+               ));
                $action->executeAction();
        }
        
@@ -483,22 +475,14 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        'data' => array(
                                'activationCode' => UserRegistrationUtil::getActivationCode()
                        ),
-                       'removeGroups' => array(
-                               UserGroup::USERS
-                       ),
-                       'groups' => array(
-                               UserGroup::GUESTS
-                       )
+                       'removeGroups' => UserGroup::getGroupIDsByType(array(UserGroup::USERS)),
                ));
                $action->executeAction();
-       
-               // update user rank
-               if (MODULE_USER_RANK) {
-                       $action = new UserProfileAction($this->objects, 'updateUserRank');
-                       $action->executeAction();
-               }
-               // update user online marking
-               $action = new UserProfileAction($this->objects, 'updateUserOnlineMarking');
+               $action = new UserAction($this->objects, 'addToGroups', array(
+                       'groups' => UserGroup::getGroupIDsByType(array(UserGroup::GUESTS)),
+                       'deleteOldGroups' => false,
+                       'addDefaultGroups' => false
+               ));
                $action->executeAction();
        }
 }