disable: function(userIDs) {
this._proxy.setOption('data', {
actionName: 'disable',
- className: 'wcf\\data\\user\\ExtendedUserAction',
+ className: 'wcf\\data\\user\\UserAction',
objectIDs: userIDs
});
this._proxy.sendRequest();
enable: function(userIDs) {
this._proxy.setOption('data', {
actionName: 'enable',
- className: 'wcf\\data\\user\\ExtendedUserAction',
+ className: 'wcf\\data\\user\\UserAction',
objectIDs: userIDs
});
this._proxy.sendRequest();
+++ /dev/null
-<?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();
- }
-}
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\StringUtil;
+use wcf\util\UserRegistrationUtil;
/**
* Executes user-related actions.
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();
+ }
}
<?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;
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();