From 648bcf08d2fb78fb935237354d0405124960b69f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 25 Oct 2012 18:39:50 +0200 Subject: [PATCH] Fix isAdminGroup in WCFSetup --- wcfsetup/install/files/acp/install.php | 16 ---------------- .../lib/data/user/group/UserGroup.class.php | 4 ++++ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/wcfsetup/install/files/acp/install.php b/wcfsetup/install/files/acp/install.php index c65a57f6f5..27739c4938 100644 --- a/wcfsetup/install/files/acp/install.php +++ b/wcfsetup/install/files/acp/install.php @@ -19,22 +19,6 @@ $sql = "UPDATE wcf".WCF_N."_package_installation_plugin $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array(1)); -// change group options from admin group to true -$sql = "UPDATE wcf".WCF_N."_user_group_option_value - SET optionValue = ? - WHERE groupID = ? - AND optionValue = ?"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(array(1, 4, '0')); - -// update accessible groups -$sql = "UPDATE wcf".WCF_N."_user_group_option_value - SET optionValue = ? - WHERE groupID = ? - AND optionValue = ?"; -$statement = WCF::getDB()->prepareStatement($sql); -$statement->execute(array('1,2,3,4,5,6', 4, '')); - // reset sessions SessionHandler::resetSessions(); diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index aec9014bdf..ae9400480a 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -197,6 +197,9 @@ class UserGroup extends DatabaseObject { * @return boolean */ public function isAdminGroup() { + // workaround for WCF-Setup + if (!PACKAGE_ID && $this->groupID == 4) return true; + $groupIDs = array_keys(self::getGroupsByType()); $accessibleGroupIDs = explode(',', $this->getGroupOption('admin.user.accessibleGroups')); @@ -297,6 +300,7 @@ class UserGroup extends DatabaseObject { ORDER BY package_dependency.priority ASC"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array(PACKAGE_ID)); + while ($row = $statement->fetchArray()) { $groupOptionIDs[$row['optionName']] = $row['optionID']; } -- 2.20.1