-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5666 from WoltLab/persistent-license-data
Persist the license data
- Loading branch information
Showing
20 changed files
with
397 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0.0.rc.1.php
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
wcfsetup/install/files/acp/update_com.woltlab.wcf_6.0_license.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?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 { | ||
$licenseApi = new LicenseApi(); | ||
$licenseData = $licenseApi->fetchFromRemote(); | ||
$licenseApi->updateLicenseFile($licenseData); | ||
|
||
// 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. | ||
} |
5 changes: 4 additions & 1 deletion
5
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Ckeditor.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.