From 3b7c9351c86af34bfa1cf518d75bc65387dd2d12 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 15 Aug 2011 17:27:47 +0200 Subject: [PATCH] Fixed a bug in UserGroupEditor And I removed some unneeded variables. --- .../files/lib/data/user/group/UserGroupEditor.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php index 73ac7f57cb..90c8fb0505 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php @@ -40,7 +40,7 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj * @see wcf\data\DatabaseObjectEditor::__deleteAll() */ public static function deleteAll(array $objectIDs = array()) { - parent::deleteAll($objectIDs); + $returnValue = parent::deleteAll($objectIDs); // remove user to group assignments self::removeGroupAssignments($objectIDs); @@ -130,12 +130,11 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj WHERE groupOption.optionname = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array('admin.user.accessibleGroups')); - while ($row = $statement->fetchArray($result)) { + while ($row = $statement->fetchArray()) { $valueIDs = explode(',', $row['optionValue']); if (in_array($groupID, $valueIDs)) { $key = array_keys($valueIDs, $groupID); if (!empty($key)) unset($valueIDs[$key[0]]); - $updateIDs = implode(",", $valueIDs); $updateStatement->execute(array(implode(',', $valueIDs), $row['groupID'], $row['optionID'])); } @@ -156,9 +155,6 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj $groupIDs[] = $row['groupID']; } - $optionID = 0; - $targetGroupIDs = array(); - $conditions = new PreparedStatementConditionBuilder(); $conditions->add("groupOption.optionName = ?", array('admin.user.accessibleGroups')); $conditions->add("groupID IN (?)", array($groupIDs)); -- 2.20.1