Add update_com.woltlab.wcf_5.6_checkForMultiDomainSetup.php
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 09:58:56 +0000 (11:58 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:24:40 +0000 (14:24 +0200)
see #4295

wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkForMultiDomainSetup.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkForMultiDomainSetup.php b/wcfsetup/install/files/acp/update_com.woltlab.wcf_5.6_checkForMultiDomainSetup.php
new file mode 100644 (file)
index 0000000..4d51aa4
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+use wcf\system\application\ApplicationHandler;
+use wcf\system\WCF;
+
+$domainName = ApplicationHandler::getInstance()->getApplicationByID(1)->domainName;
+foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
+    if ($application->domainName !== $domainName) {
+        if (WCF::getLanguage()->getFixedLanguageCode() === 'de') {
+            $message = "Die installierten Apps befinden sich auf unterschiedlichen Domains.";
+        } else {
+            $message = "The installed apps are running on different domains.";
+        }
+
+        throw new \RuntimeException($message);
+    }
+}