From e62da33642c25a4ef2e12bf4b454f41e30433910 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 26 Oct 2013 19:41:01 +0200 Subject: [PATCH] Fixed multiple issues --- .../acp/form/UserBulkProcessingForm.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php b/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php index 0086385923..776eacbd53 100644 --- a/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php @@ -220,6 +220,11 @@ class UserBulkProcessingForm extends UserOptionListForm { // build conditions $this->conditions = new PreparedStatementConditionBuilder(); + // deny self delete + if ($this->action == 'delete') { + $this->conditions->add("user_table.userID <> ?", array(WCF::getUser()->userID)); + } + // static fields if (!empty($this->username)) { $this->conditions->add("user_table.username LIKE ?", array('%'.addcslashes($this->username, '_%').'%')); @@ -365,7 +370,9 @@ class UserBulkProcessingForm extends UserOptionListForm { $user->addToGroups($_this->assignToGroupIDs, false, false); }); - UserStorageHandler::getInstance()->reset($userIDs, 'groupIDs', 1); + if (!empty($userIDs)) { + UserStorageHandler::getInstance()->reset($userIDs, 'groupIDs', 1); + } break; case 'delete': @@ -373,8 +380,10 @@ class UserBulkProcessingForm extends UserOptionListForm { $userIDs = $this->fetchUsers(); - $userAction = new UserAction($userIDs, 'delete'); - $userAction->executeAction(); + if (!empty($userIDs)) { + $userAction = new UserAction($userIDs, 'delete'); + $userAction->executeAction(); + } break; } $this->saved(); @@ -402,6 +411,7 @@ class UserBulkProcessingForm extends UserOptionListForm { while ($row = $statement->fetchArray()) { $users[$row['userID']] = $row; } + if (empty($users)) return array(); // select group ids $conditions = new PreparedStatementConditionBuilder(); -- 2.20.1