Removed obsolete code
authorMarcel Werk <burntime@woltlab.com>
Sun, 2 Jun 2013 14:44:06 +0000 (16:44 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 2 Jun 2013 14:44:06 +0000 (16:44 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.User.js
wcfsetup/install/files/lib/data/user/ExtendedUserAction.class.php [deleted file]
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/form/RegisterActivationForm.class.php

index 0ab753289d35199287dc65bd96260808331c71d9..7f597c696384a444d0213dfc225b3a344c0d0d5e 100644 (file)
@@ -59,7 +59,7 @@ WCF.ACP.User.EnableHandler = {
        disable: function(userIDs) {
                this._proxy.setOption('data', {
                        actionName: 'disable',
-                       className: 'wcf\\data\\user\\ExtendedUserAction',
+                       className: 'wcf\\data\\user\\UserAction',
                        objectIDs: userIDs
                });
                this._proxy.sendRequest();
@@ -73,7 +73,7 @@ WCF.ACP.User.EnableHandler = {
        enable: function(userIDs) {
                this._proxy.setOption('data', {
                        actionName: 'enable',
-                       className: 'wcf\\data\\user\\ExtendedUserAction',
+                       className: 'wcf\\data\\user\\UserAction',
                        objectIDs: userIDs
                });
                this._proxy.sendRequest();
diff --git a/wcfsetup/install/files/lib/data/user/ExtendedUserAction.class.php b/wcfsetup/install/files/lib/data/user/ExtendedUserAction.class.php
deleted file mode 100644 (file)
index b73e80d..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-namespace wcf\data\user;
-use wcf\data\user\group\UserGroup;
-use wcf\data\AbstractDatabaseObjectAction;
-use wcf\system\WCF;
-use wcf\util\UserRegistrationUtil;
-
-/**
- * Executes user-related actions.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2013 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf.user
- * @subpackage data.user
- * @category   Community Framework
- */
-class ExtendedUserAction extends AbstractDatabaseObjectAction {
-       /**
-        * @see wcf\data\AbstractDatabaseObjectAction::$className
-        */
-       public $className = 'wcf\data\user\UserEditor';
-       
-       /**
-        * Validates the enable action.
-        */
-       public function validateEnable() {
-               WCF::getSession()->checkPermissions(array('admin.user.canEnableUser'));
-       }
-       
-       /**
-        * Validates the disable action.
-        */
-       public function validateDisable() {
-               $this->validateEnable();
-       }
-       
-       /**
-        * Enables users.
-        */
-       public function enable() {
-               if (empty($this->objects)) $this->readObjects();
-               
-               $action = new UserAction($this->objects, 'update', array(
-                       'data' => array(
-                               'activationCode' => 0
-                       ),
-                       'groups' => array(
-                               UserGroup::USERS
-                       ),
-                       'removeGroups' => 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->executeAction();
-       }
-       
-       /**
-        * Disables users.
-        */
-       public function disable() {
-               if (empty($this->objects)) $this->readObjects();
-               
-               $action = new UserAction($this->objects, 'update', array(
-                       'data' => array(
-                               'activationCode' => UserRegistrationUtil::getActivationCode()
-                       ),
-                       'removeGroups' => array(
-                               UserGroup::USERS
-                       ),
-                       'groups' => 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->executeAction();
-       }
-}
index a96d19efdd9c05b582718eaddfbbaaf666dbe5b4..fe83e8ed382221dd2d30f6943075bfc710d0d77d 100644 (file)
@@ -13,6 +13,7 @@ use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\WCF;
 use wcf\util\StringUtil;
+use wcf\util\UserRegistrationUtil;
 
 /**
  * Executes user-related actions.
@@ -428,4 +429,76 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio
                        ClipboardHandler::getInstance()->unmark($userIDs, ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user'));
                }
        }
+       
+       /**
+        * Validates the enable action.
+        */
+       public function validateEnable() {
+               WCF::getSession()->checkPermissions(array('admin.user.canEnableUser'));
+       }
+       
+       /**
+        * Validates the disable action.
+        */
+       public function validateDisable() {
+               $this->validateEnable();
+       }
+       
+       /**
+        * Enables users.
+        */
+       public function enable() {
+               if (empty($this->objects)) $this->readObjects();
+       
+               $action = new UserAction($this->objects, 'update', array(
+                       'data' => array(
+                               'activationCode' => 0
+                       ),
+                       'groups' => array(
+                               UserGroup::USERS
+                       ),
+                       'removeGroups' => 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->executeAction();
+       }
+       
+       /**
+        * Disables users.
+        */
+       public function disable() {
+               if (empty($this->objects)) $this->readObjects();
+       
+               $action = new UserAction($this->objects, 'update', array(
+                       'data' => array(
+                               'activationCode' => UserRegistrationUtil::getActivationCode()
+                       ),
+                       'removeGroups' => array(
+                               UserGroup::USERS
+                       ),
+                       'groups' => 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->executeAction();
+       }
 }
index a2dd27d15f479e17237f432ea26821252b786dd0..7b8eb1299df4f59c8abd7d9a3558609ab0943a4b 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\group\UserGroup;
-use wcf\data\user\ExtendedUserAction;
+use wcf\data\user\UserAction;
 use wcf\data\user\User;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\NamedUserException;
@@ -80,7 +80,7 @@ class RegisterActivationForm extends AbstractForm {
                parent::save();
                
                // enable user
-               $this->objectAction = new ExtendedUserAction(array($this->user), 'enable');
+               $this->objectAction = new UserAction(array($this->user), 'enable');
                $this->objectAction->executeAction();
                $this->saved();