<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_favicon.php</instruction>
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_trophies.php</instruction>
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_removeDownloadedGravatars.php</instruction>
+ <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_license.php</instruction>
<!-- Clean Up. -->
<instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_removeLegacyAppConfig.php</instruction>
<instruction type="templateDelete" />
</instructions>
+ <!--
+ Include in the update RC 1 → RC 2:
+
+ <instruction type="script" run="standalone">acp/update_com.woltlab.wcf_6.0_license.php</instruction>
+ -->
+
<instructions type="update" fromversion="6.0.0 Beta 4">
<instruction type="acpTemplate">acptemplates_update.tar</instruction>
<instruction type="file">files_update.tar</instruction>
+++ /dev/null
-<?php
-
-/**
- * Fixes the style variable value of `individualScssDarkMode`.
- *
- * @author Alexander Ebert
- * @copyright 2001-2023 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- */
-
-use wcf\system\WCF;
-
-// Follow-up for https://github.com/WoltLab/WCF/commit/ccf4bcc71444a0c75c7543483585706895b51bd8
-$sql = "UPDATE wcf1_style_variable_value
- SET variableValueDarkMode = ?
- WHERE variableID = (
- SELECT variableID
- FROM wcf1_style_variable
- WHERE variableName = ?
- )";
-$statement = WCF::getDB()->prepare($sql);
-$statement->execute([null, 'individualScssDarkMode']);
--- /dev/null
+<?php
+
+/**
+ * Validates the license credentials and writes the license file.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ */
+
+use wcf\data\package\update\server\PackageUpdateServer;
+use wcf\data\package\update\server\PackageUpdateServerEditor;
+use wcf\system\package\license\LicenseApi;
+
+try {
+ // Side-effect: Writes the license file.
+ LicenseApi::fetchFromRemote();
+
+ // If we’re still here it means that the credentials are actually valid. Now
+ // we can check if the credentials for both servers are in sync, because
+ // traditionally users could use their account credentials to authenticate.
+ $updateServer = PackageUpdateServer::getWoltLabUpdateServer();
+ $storeServer = PackageUpdateServer::getPluginStoreServer();
+
+ if ($updateServer->getAuthData() !== $storeServer->getAuthData()) {
+ $authData = $updateServer->getAuthData();
+
+ (new PackageUpdateServerEditor($storeServer))->update([
+ 'username' => $authData['username'],
+ 'password' => $authData['password'],
+ ]);
+ }
+} catch (\Throwable) {
+ // This action must be silent, failing to execute is not an issue here.
+}