<packagedescription><![CDATA[Free web-framework, designed and developed for complex community applications.]]></packagedescription>
<packagedescription language="de"><![CDATA[Freies Web-Framework, das für komplexe Community-Anwendungen entworfen und entwickelt wurde.]]></packagedescription>
<isapplication>1</isapplication>
- <version>2.1.0 RC 1</version> <!-- codename: typhoon -->
+ <version>2.1.0 RC 2</version> <!-- codename: typhoon -->
<date>2015-02-16</date>
</packageinformation>
<instruction type="script" run="standalone">acp/rebuild_comments_com.woltlab.wcf_2.1.php</instruction>
</instructions>
- <instructions type="update" fromversion="2.1.0 Beta 4">
- <instruction type="option">option.xml</instruction>
+ <instructions type="update" fromversion="2.1.0 RC 1">
<instruction type="file">files_update.tar</instruction>
- <instruction type="script">acp/update_com.woltlab.wcf_2.1.0_rc_1.php</instruction>
-
- <instruction type="language" run="standalone">language/*.xml</instruction>
-
- <instruction type="acpTemplate">acptemplates_update.tar</instruction>
- <instruction type="template">templates_update.tar</instruction>
-
- <instruction type="sql">update_2.1.0_rc_1.sql</instruction>
-
- <instruction type="userGroupOption">userGroupOption.xml</instruction>
+ <instruction type="script">acp/update_accessibleGroups_com.woltlab.wcf_2.1.0_rc_2.php</instruction>
</instructions>
</package>
<categoryname>admin.user.group</categoryname>
<optiontype>userGroups</optiontype>
<defaultvalue></defaultvalue>
- <admindefaultvalue>1,2,3,4,5,6</admindefaultvalue>
+ <admindefaultvalue>1,2,3,4,5</admindefaultvalue>
<usersonly>1</usersonly>
</option>
<option name="admin.user.canAddUser">
--- /dev/null
+<?php
+use wcf\system\WCF;
+
+/**
+ * @author Alexander Ebert
+ * @copyright 2001-2015 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @category Community Framework
+ */
+
+// fix superfluous group ID in accessibleGroups list
+$sql = "SELECT groupID
+ FROM wcf".WCF_N."_user_group";
+$statement = WCF::getDB()->prepareStatement($sql);
+$statement->execute();
+$validGroupIDs = array();
+while ($row = $statement->fetchArray()) {
+ $validGroupIDs[] = $row['groupID'];
+}
+
+$sql = "SELECT *
+ FROM wcf".WCF_N."_user_group_option_value
+ WHERE optionID = (
+ SELECT optionID
+ FROM wcf".WCF_N."_user_group_option
+ WHERE optionName = 'admin.user.accessibleGroups'
+ )";
+$statement = WCF::getDB()->prepareStatement($sql);
+$statement->execute();
+$updateData = array();
+$optionID = 0;
+while ($row = $statement->fetchArray()) {
+ $optionID = $row['optionID'];
+ $groupIDs = explode(',', $row['optionValue']);
+ $newGroupIDs = array();
+ for ($i = 0, $length = count($groupIDs); $i < $length; $i++) {
+ $groupID = $groupIDs[$i];
+ if (in_array($groupID, $validGroupIDs)) {
+ $newGroupIDs[] = $groupID;
+ }
+ }
+
+ $updateData[$row['groupID']] = implode(',', $newGroupIDs);
+}
+
+$sql = "UPDATE wcf".WCF_N."_user_group_option_value
+ SET optionValue = ?
+ WHERE groupID = ?
+ AND optionID = ?";
+$statement = WCF::getDB()->prepareStatement($sql);
+
+WCF::getDB()->beginTransaction();
+foreach ($updateData as $groupID => $optionValue) {
+ $statement->execute(array(
+ $optionValue,
+ $groupID,
+ $optionID
+ ));
+}
+WCF::getDB()->commitTransaction();
+++ /dev/null
-<?php
-use wcf\data\option\OptionEditor;
-
-/**
- * @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package com.woltlab.wcf
- * @category Community Framework
- */
-
-// rebuild options during update to properly handle new option
-OptionEditor::resetCache();
}
// define current wcf version
-define('WCF_VERSION', '2.1.0 RC 1 (Typhoon)');
+define('WCF_VERSION', '2.1.0 RC 2 (Typhoon)');
// define current unix timestamp
define('TIME_NOW', time());