Fix isAdminGroup in WCFSetup
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Oct 2012 16:39:50 +0000 (18:39 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 25 Oct 2012 16:39:50 +0000 (18:39 +0200)
wcfsetup/install/files/acp/install.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php

index c65a57f6f5198a285634b85878f80f270cb72ec3..27739c493856d8cc9736442c63175c312583cd11 100644 (file)
@@ -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();
 
index aec9014bdf7c12d7965edce3147dfb7b332a84c8..ae9400480ae0247b524e20bfc7879189d6108cc4 100644 (file)
@@ -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'];
                        }