674202f843fd49e1b77f56a2137c50594b8bb5f9
[GitHub/WoltLab/WCF.git] /
1 <?php
2 namespace wcf\system\bulk\processing\user;
3 use wcf\data\user\UserEditor;
4 use wcf\system\WCF;
5
6 /**
7 * Bulk processing action implementation for removing users from user groups.
8 *
9 * @author Matthias Schmidt
10 * @copyright 2001-2018 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package WoltLabSuite\Core\System\Bulk\Processing\User
13 * @since 3.0
14 */
15 class RemoveFromUserGroupsUserBulkProcessingAction extends AbstractUserGroupsUserBulkProcessingAction {
16 /**
17 * @inheritDoc
18 */
19 public $inputName = 'removeFromUserGroupIDs';
20
21 /**
22 * @inheritDoc
23 */
24 protected function executeUserAction(UserEditor $user) {
25 $user->removeFromGroups($this->userGroupIDs);
26 }
27
28 /**
29 * @inheritDoc
30 */
31 public function getObjectList() {
32 $userList = parent::getObjectList();
33
34 // the active user may not remove themselves from any user group
35 // to avoid potential permission issues
36 $userList->getConditionBuilder()->add('user_table.userID <> ?', [WCF::getUser()->userID]);
37
38 return $userList;
39 }
40 }