From: Alexander Ebert Date: Mon, 11 Sep 2023 12:12:40 +0000 (+0200) Subject: Add a check for legacy multi domain setups X-Git-Tag: 6.0.0_RC_1~5^2~2^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0aa0c26fd0cf3bbbd909c3c4959f2d407dcdf6e6;p=GitHub%2FWoltLab%2FWCF.git Add a check for legacy multi domain setups --- diff --git a/wcfsetup/install/files/lib/acp/form/PackageEnableUpgradeOverrideForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageEnableUpgradeOverrideForm.class.php index d275a4e290..9497e2109d 100644 --- a/wcfsetup/install/files/lib/acp/form/PackageEnableUpgradeOverrideForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageEnableUpgradeOverrideForm.class.php @@ -6,6 +6,7 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\data\package\update\server\PackageUpdateServer; use wcf\form\AbstractForm; use wcf\form\AbstractFormBuilderForm; +use wcf\system\application\ApplicationHandler; use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\event\EventHandler; use wcf\system\exception\IllegalLinkException; @@ -111,6 +112,7 @@ final class PackageEnableUpgradeOverrideForm extends AbstractFormBuilderForm $this->checkPhpX64(), $this->checkMinimumDatabaseVersion(), $this->checkMysqlNativeDriver(), + $this->checkForAppsWithDifferentDomains(), ]; return \array_filter($issues); @@ -275,6 +277,39 @@ final class PackageEnableUpgradeOverrideForm extends AbstractFormBuilderForm } } + private function checkForAppsWithDifferentDomains(): ?array + { + $usesDifferentDomains = false; + $domainName = ''; + foreach (ApplicationHandler::getInstance()->getApplications() as $application) { + if ($domainName === '') { + $domainName = $application->domainName; + continue; + } + + if ($domainName !== $application->domainName) { + $usesDifferentDomains = true; + break; + } + } + + if (!$usesDifferentDomains) { + return null; + } + + if (WCF::getLanguage()->getFixedLanguageCode() === 'de') { + return [ + 'title' => 'Nutzung mehrerer Domains', + 'description' => 'Der Betrieb von Apps auf unterschiedlichen (Sub-)Domains wird nicht mehr unterstützt.', + ]; + } else { + return [ + 'title' => 'Using multiple domains', + 'description' => 'The support for apps running on different (sub)domains has been discontinued.', + ]; + } + } + /** * @inheritDoc */