Remove code paths that are only taken if `->isMultiDomainSetup()` returns `true`
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 10:01:17 +0000 (12:01 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:24:40 +0000 (14:24 +0200)
see #4295

wcfsetup/install/files/acp/templates/applicationEdit.tpl [deleted file]
wcfsetup/install/files/acp/templates/applicationManagement.tpl
wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php [deleted file]
wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/style/StyleCompiler.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

diff --git a/wcfsetup/install/files/acp/templates/applicationEdit.tpl b/wcfsetup/install/files/acp/templates/applicationEdit.tpl
deleted file mode 100644 (file)
index fc43a29..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-{include file='header' pageTitle='wcf.acp.application.edit'}
-
-<header class="contentHeader">
-       <div class="contentHeaderTitle">
-               <h1 class="contentTitle">{lang}wcf.acp.application.edit.title{/lang}</h1>
-       </div>
-       
-       <nav class="contentHeaderNavigation">
-               <ul>
-                       <li><a href="{link controller='ApplicationManagement'}{/link}" class="button"><span class="icon icon16 fa-list"></span> <span>{lang}wcf.acp.menu.link.application.management{/lang}</span></a></li>
-                       
-                       {event name='contentHeaderNavigation'}
-               </ul>
-       </nav>
-</header>
-
-{include file='formError'}
-
-{if $success|isset}
-       <p class="success">{lang}wcf.global.success.edit{/lang}</p>
-{/if}
-
-<form method="post" action="{link controller='ApplicationEdit' id=$application->packageID}{/link}">
-       <section class="section">
-               <h2 class="sectionTitle">{lang}wcf.acp.application.domain{/lang}</h2>
-               
-               <dl{if $errorField == 'domainName'} class="formError"{/if}>
-                       <dt><label for="domainName">{lang}wcf.acp.application.domainName{/lang}</label></dt>
-                       <dd>
-                               <input type="text" name="domainName" id="domainName" value="{$domainName}" class="long">
-                               {if $errorField == 'domainName'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.application.domainName.error.{$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                               <small>{lang}wcf.acp.application.domainName.description{/lang}</small>
-                       </dd>
-               </dl>
-               
-               <dl{if $errorField == 'domainPath'} class="formError"{/if}>
-                       <dt><label for="domainPath">{lang}wcf.acp.application.domainPath{/lang}</label></dt>
-                       <dd>
-                               <input type="text" name="domainPath" id="domainPath" value="{$domainPath}" class="long">
-                               <small>{lang}wcf.acp.application.domainPath.description{/lang}</small>
-                               {if $errorField == 'domainPath'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.application.domainPath.error.{$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               <dl>
-                       <dt><label for="landingPageID">{lang}wcf.acp.application.landingPage{/lang}</label></dt>
-                       <dd>
-                               <select name="landingPageID" id="landingPageID">
-                                       <option value="0">{lang}wcf.global.noSelection{/lang}</option>
-                                       
-                                       {foreach from=$pageNodeList item=pageNode}
-                                               {if !$pageNode->isDisabled && !$pageNode->requireObjectID && !$pageNode->excludeFromLandingPage}
-                                                       <option value="{@$pageNode->pageID}"{if $pageNode->pageID == $landingPageID} selected{/if} data-identifier="{@$pageNode->identifier}">{if $pageNode->getDepth() > 1}{@"&nbsp;&nbsp;&nbsp;&nbsp;"|str_repeat:($pageNode->getDepth() - 1)}{/if}{$pageNode->name}</option>
-                                               {/if}
-                                       {/foreach}
-                               </select>
-                               <small>{lang}wcf.acp.application.landingPage.description{/lang}</small>
-                       </dd>
-               </dl>
-               
-               {event name='domainFields'}
-       </section>
-       
-       <section class="section">
-               <header class="sectionHeader">
-                       <h2 class="sectionTitle">{lang}wcf.acp.application.cookie{/lang}</h2>
-                       <p class="sectionDescription">{lang}wcf.acp.application.cookie.warning{/lang}</p>
-               </header>
-               
-               <dl{if $errorField == 'cookieDomain'} class="formError"{/if}>
-                       <dt><label for="cookieDomain">{lang}wcf.acp.application.cookieDomain{/lang}</label></dt>
-                       <dd>
-                               <input type="text" name="cookieDomain" id="cookieDomain" value="{$cookieDomain}" class="long">
-                               {if $errorField == 'cookieDomain'}
-                                       <small class="innerError">
-                                               {if $errorType == 'empty'}
-                                                       {lang}wcf.global.form.error.empty{/lang}
-                                               {else}
-                                                       {lang}wcf.acp.application.cookieDomain.error.{$errorType}{/lang}
-                                               {/if}
-                                       </small>
-                               {/if}
-                       </dd>
-               </dl>
-               
-               {event name='cookieFields'}
-       </section>
-       
-       {event name='sections'}
-       
-       <div class="formSubmit">
-               <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
-               {csrfToken}
-       </div>
-</form>
-
-{include file='footer'}
index 8e826aab1b2820021effb9665cd9d48ac86453ac..d3057d3b1f8d9a6d05ae0c3133b527f5470272bc 100644 (file)
        {/hascontent}
 </header>
 
-{if $isMultiDomainSetup}
-       <div class="warning">{lang}wcf.acp.application.multiDomain{/lang}</div>
-{/if}
-
 {include file='formNotice' action='edit'}
 
 <form method="post" action="{link controller='ApplicationManagement'}{/link}">
-       {if !$isMultiDomainSetup}
-               <section class="section">
-                       <h2 class="sectionTitle">{lang}wcf.acp.application.management.domain{/lang}</h2>
+       <section class="section">
+               <h2 class="sectionTitle">{lang}wcf.acp.application.management.domain{/lang}</h2>
 
-                       <dl{if $errorField == 'domainName'} class="formError"{/if}>
-                               <dt><label for="domainName">{lang}wcf.acp.application.management.domainName{/lang}</label></dt>
-                               <dd>
-                                       <div class="inputAddon">
-                                               <span class="inputPrefix">https://</span>
-                                               <input type="text" name="domainName" id="domainName" value="{$domainName}" class="long">
-                                       </div>
-                                       {if $errorField == 'domainName'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
-                                                       {else}
-                                                               {lang}wcf.acp.application.management.domainName.error.{$errorType}{/lang}
-                                                       {/if}
-                                               </small>
-                                       {/if}
-                                       <small>{lang}wcf.acp.application.management.domainName.description{/lang}</small>
-                               </dd>
-                       </dl>
+               <dl{if $errorField == 'domainName'} class="formError"{/if}>
+                       <dt><label for="domainName">{lang}wcf.acp.application.management.domainName{/lang}</label></dt>
+                       <dd>
+                               <div class="inputAddon">
+                                       <span class="inputPrefix">https://</span>
+                                       <input type="text" name="domainName" id="domainName" value="{$domainName}" class="long">
+                               </div>
+                               {if $errorField == 'domainName'}
+                                       <small class="innerError">
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.acp.application.management.domainName.error.{$errorType}{/lang}
+                                               {/if}
+                                       </small>
+                               {/if}
+                               <small>{lang}wcf.acp.application.management.domainName.description{/lang}</small>
+                       </dd>
+               </dl>
 
-                       <dl{if $errorField == 'cookieDomain'} class="formError"{/if}>
-                               <dt><label for="cookieDomain">{lang}wcf.acp.application.management.cookieDomain{/lang}</label></dt>
-                               <dd>
-                                       <input type="text" name="cookieDomain" id="cookieDomain" value="{$cookieDomain}" class="long">
-                                       {if $errorField == 'cookieDomain'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}
-                                                               {lang}wcf.global.form.error.empty{/lang}
-                                                       {else}
-                                                               {lang}wcf.acp.application.management.cookieDomain.error.{$errorType}{/lang}
-                                                       {/if}
-                                               </small>
-                                       {/if}
-                                       <small>{lang}wcf.acp.application.management.cookieDomain.description{/lang}</small>
-                               </dd>
-                       </dl>
-               </section>
+               <dl{if $errorField == 'cookieDomain'} class="formError"{/if}>
+                       <dt><label for="cookieDomain">{lang}wcf.acp.application.management.cookieDomain{/lang}</label></dt>
+                       <dd>
+                               <input type="text" name="cookieDomain" id="cookieDomain" value="{$cookieDomain}" class="long">
+                               {if $errorField == 'cookieDomain'}
+                                       <small class="innerError">
+                                               {if $errorType == 'empty'}
+                                                       {lang}wcf.global.form.error.empty{/lang}
+                                               {else}
+                                                       {lang}wcf.acp.application.management.cookieDomain.error.{$errorType}{/lang}
+                                               {/if}
+                                       </small>
+                               {/if}
+                               <small>{lang}wcf.acp.application.management.cookieDomain.description{/lang}</small>
+                       </dd>
+               </dl>
+       </section>
 
-               {* Keep the cookie domain in sync if it was previously identical. *}
-               {if $domainName === $cookieDomain}
-                       <script>
-                               (() => {
-                                       const domainName = document.getElementById("domainName");
-                                       const cookieDomain = document.getElementById("cookieDomain");
+       {* Keep the cookie domain in sync if it was previously identical. *}
+       {if $domainName === $cookieDomain}
+               <script>
+                       (() => {
+                               const domainName = document.getElementById("domainName");
+                               const cookieDomain = document.getElementById("cookieDomain");
 
-                                       domainName.addEventListener("input", () => {
-                                               cookieDomain.value = domainName.value;
-                                       });
-                               })();
-                       </script>
-               {/if}
+                               domainName.addEventListener("input", () => {
+                                       cookieDomain.value = domainName.value;
+                               });
+                       })();
+               </script>
        {/if}
 
        <section class="section">
diff --git a/wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php b/wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php
deleted file mode 100644 (file)
index 1e761a9..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-<?php
-
-namespace wcf\acp\form;
-
-use wcf\data\application\Application;
-use wcf\data\application\ApplicationAction;
-use wcf\data\application\ViewableApplication;
-use wcf\data\package\PackageCache;
-use wcf\data\page\Page;
-use wcf\data\page\PageNodeTree;
-use wcf\form\AbstractForm;
-use wcf\system\application\ApplicationHandler;
-use wcf\system\cache\builder\ApplicationCacheBuilder;
-use wcf\system\cache\builder\RoutingCacheBuilder;
-use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\UserInputException;
-use wcf\system\Regex;
-use wcf\system\WCF;
-use wcf\util\FileUtil;
-use wcf\util\StringUtil;
-
-/**
- * Shows the application edit form.
- *
- * @author  Alexander Ebert
- * @copyright   2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\Acp\Form
- */
-class ApplicationEditForm extends AbstractForm
-{
-    /**
-     * @inheritDoc
-     */
-    public $activeMenuItem = 'wcf.acp.menu.link.application.management';
-
-    /**
-     * viewable application object
-     * @var ViewableApplication
-     */
-    public $application;
-
-    /**
-     * cookie domain
-     * @var string
-     */
-    public $cookieDomain = '';
-
-    /**
-     * domain name
-     * @var string
-     */
-    public $domainName = '';
-
-    /**
-     * domain path
-     * @var string
-     */
-    public $domainPath = '';
-
-    /**
-     * landing page id
-     * @var int
-     */
-    public $landingPageID = 0;
-
-    /**
-     * @inheritDoc
-     */
-    public $neededPermissions = ['admin.configuration.canManageApplication'];
-
-    /**
-     * application package id
-     * @var int
-     */
-    public $packageID = 0;
-
-    /**
-     * @inheritDoc
-     */
-    public $templateName = 'applicationEdit';
-
-    /**
-     * nested list of page nodes
-     * @var \RecursiveIteratorIterator
-     */
-    public $pageNodeList;
-
-    /**
-     * @inheritDoc
-     */
-    public function readParameters()
-    {
-        parent::readParameters();
-
-        if (!ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            throw new IllegalLinkException();
-        }
-
-        if (isset($_REQUEST['id'])) {
-            $this->packageID = \intval($_REQUEST['id']);
-        }
-        $this->application = new ViewableApplication(new Application($this->packageID));
-        if (!$this->application->packageID) {
-            throw new IllegalLinkException();
-        }
-
-        $this->pageNodeList = (new PageNodeTree())->getNodeList();
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function readFormParameters()
-    {
-        parent::readFormParameters();
-
-        if (isset($_POST['cookieDomain'])) {
-            $this->cookieDomain = StringUtil::trim($_POST['cookieDomain']);
-        }
-        if (isset($_POST['domainName'])) {
-            $this->domainName = StringUtil::trim($_POST['domainName']);
-        }
-        if (isset($_POST['domainPath'])) {
-            $this->domainPath = StringUtil::trim($_POST['domainPath']);
-        }
-        if (isset($_POST['landingPageID'])) {
-            $this->landingPageID = \intval($_POST['landingPageID']);
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function readData()
-    {
-        parent::readData();
-
-        if (empty($_POST)) {
-            $this->cookieDomain = $this->application->cookieDomain;
-            $this->domainName = $this->application->domainName;
-            $this->domainPath = $this->application->domainPath;
-            $this->landingPageID = $this->application->landingPageID;
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function validate()
-    {
-        parent::validate();
-
-        if (empty($this->domainName)) {
-            throw new UserInputException('domainName');
-        } else {
-            $regex = new Regex('^https?\://');
-            $this->domainName = FileUtil::removeTrailingSlash($regex->replace($this->domainName, ''));
-            $this->cookieDomain = FileUtil::removeTrailingSlash($regex->replace($this->cookieDomain, ''));
-
-            // domain may not contain path components
-            $regex = new Regex('[/#\?&]');
-            if ($regex->match($this->domainName)) {
-                throw new UserInputException('domainName', 'containsPath');
-            } elseif ($regex->match($this->cookieDomain)) {
-                throw new UserInputException('cookieDomain', 'containsPath');
-            }
-
-            // strip port from cookie domain
-            $regex = new Regex(':[0-9]+$');
-            $this->cookieDomain = $regex->replace($this->cookieDomain, '');
-
-            // check if cookie domain shares the same domain (may exclude subdomains)
-            if (!\str_ends_with($regex->replace($this->domainName, ''), $this->cookieDomain)) {
-                throw new UserInputException('cookieDomain', 'invalid');
-            }
-        }
-
-        // add slashes
-        $this->domainPath = FileUtil::addLeadingSlash(FileUtil::addTrailingSlash($this->domainPath));
-
-        // search for other applications with the same domain and path
-        $sql = "SELECT  packageID
-                FROM    wcf" . WCF_N . "_application
-                WHERE   domainName = ?
-                    AND domainPath = ?
-                    AND packageID <> ?";
-        $statement = WCF::getDB()->prepareStatement($sql, 1);
-        $statement->execute([
-            $this->domainName,
-            $this->domainPath,
-            $this->application->packageID,
-        ]);
-        $row = $statement->fetchArray();
-        if ($row) {
-            WCF::getTPL()->assign('conflictApplication', PackageCache::getInstance()->getPackage($row['packageID']));
-            throw new UserInputException('domainPath', 'conflict');
-        }
-
-        if ($this->landingPageID) {
-            $page = new Page($this->landingPageID);
-            if (!$page->pageID) {
-                throw new UserInputException('landingPageID');
-            } elseif ($page->requireObjectID || $page->excludeFromLandingPage || $page->isDisabled) {
-                throw new UserInputException('landingPageID', 'invalid');
-            }
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function save()
-    {
-        parent::save();
-
-        // save application
-        $this->objectAction = new ApplicationAction([$this->application->getDecoratedObject()], 'update', [
-            'data' => \array_merge($this->additionalFields, [
-                'cookieDomain' => \mb_strtolower($this->cookieDomain),
-                'domainName' => \mb_strtolower($this->domainName),
-                'domainPath' => $this->domainPath,
-                'landingPageID' => ($this->landingPageID ?: null),
-            ]),
-        ]);
-        $this->objectAction->executeAction();
-
-        $this->saved();
-
-        if ($this->application->packageID === 1) {
-            if ($this->landingPageID) {
-                (new Page($this->landingPageID))->setAsLandingPage();
-            } else {
-                $sql = "UPDATE  wcf" . WCF_N . "_page
-                        SET     isLandingPage = ?
-                        WHERE   isLandingPage = ?";
-                $statement = WCF::getDB()->prepareStatement($sql);
-                $statement->execute([
-                    0,
-                    1,
-                ]);
-            }
-        }
-
-        // re-calculate cookie settings
-        ApplicationHandler::rebuild();
-
-        // reset caches to reflect new landing page
-        ApplicationCacheBuilder::getInstance()->reset();
-        RoutingCacheBuilder::getInstance()->reset();
-
-        // show success message
-        WCF::getTPL()->assign('success', true);
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function assignVariables()
-    {
-        parent::assignVariables();
-
-        WCF::getTPL()->assign([
-            'application' => $this->application,
-            'cookieDomain' => $this->cookieDomain,
-            'domainName' => $this->domainName,
-            'domainPath' => $this->domainPath,
-            'packageID' => $this->packageID,
-            'pageNodeList' => $this->pageNodeList,
-            'landingPageID' => $this->landingPageID,
-        ]);
-    }
-}
index 559997aaaaf684f0383d8c0adb88a6b3d3bdf1f6..85412bad42a95e20f4dc024893168c968de6921f 100644 (file)
@@ -11,7 +11,6 @@ use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\builder\ApplicationCacheBuilder;
 use wcf\system\cache\builder\PageCacheBuilder;
 use wcf\system\cache\builder\RoutingCacheBuilder;
-use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\Regex;
 use wcf\system\WCF;
@@ -98,36 +97,29 @@ final class ApplicationManagementForm extends AbstractForm
     {
         parent::validate();
 
-        if (ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            // Changes to the domain for all apps are only possible for setups using the same domain.
-            if (!empty($this->cookieDomain) || !empty($this->domainName)) {
-                throw new PermissionDeniedException();
-            }
-        } else {
-            if (empty($this->domainName)) {
-                throw new UserInputException('domainName');
-            }
+        if (empty($this->domainName)) {
+            throw new UserInputException('domainName');
+        }
 
-            $regex = new Regex('^https?\://');
-            $this->domainName = FileUtil::removeTrailingSlash($regex->replace($this->domainName, ''));
-            $this->cookieDomain = FileUtil::removeTrailingSlash($regex->replace($this->cookieDomain, ''));
+        $regex = new Regex('^https?\://');
+        $this->domainName = FileUtil::removeTrailingSlash($regex->replace($this->domainName, ''));
+        $this->cookieDomain = FileUtil::removeTrailingSlash($regex->replace($this->cookieDomain, ''));
 
-            // domain may not contain path components
-            $regex = new Regex('[/#\?&]');
-            if ($regex->match($this->domainName)) {
-                throw new UserInputException('domainName', 'containsPath');
-            } elseif ($regex->match($this->cookieDomain)) {
-                throw new UserInputException('cookieDomain', 'containsPath');
-            }
+        // domain may not contain path components
+        $regex = new Regex('[/#\?&]');
+        if ($regex->match($this->domainName)) {
+            throw new UserInputException('domainName', 'containsPath');
+        } elseif ($regex->match($this->cookieDomain)) {
+            throw new UserInputException('cookieDomain', 'containsPath');
+        }
 
-            // strip port from cookie domain
-            $regex = new Regex(':[0-9]+$');
-            $this->cookieDomain = $regex->replace($this->cookieDomain, '');
+        // strip port from cookie domain
+        $regex = new Regex(':[0-9]+$');
+        $this->cookieDomain = $regex->replace($this->cookieDomain, '');
 
-            // check if cookie domain shares the same domain (may exclude subdomains)
-            if (!\str_ends_with($regex->replace($this->domainName, ''), $this->cookieDomain)) {
-                throw new UserInputException('cookieDomain', 'invalid');
-            }
+        // check if cookie domain shares the same domain (may exclude subdomains)
+        if (!\str_ends_with($regex->replace($this->domainName, ''), $this->cookieDomain)) {
+            throw new UserInputException('cookieDomain', 'invalid');
         }
 
         foreach ($this->landingPageID as $landingPageID) {
@@ -154,27 +146,23 @@ final class ApplicationManagementForm extends AbstractForm
         $this->applicationList = new ViewableApplicationList();
         $this->applicationList->readObjects();
 
-        if (!ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            $core = ApplicationHandler::getInstance()->getApplicationByID(1);
-            $this->domainName = $core->domainName;
-            $this->cookieDomain = $core->cookieDomain;
-        }
+        $core = ApplicationHandler::getInstance()->getApplicationByID(1);
+        $this->domainName = $core->domainName;
+        $this->cookieDomain = $core->cookieDomain;
     }
 
     public function save()
     {
         parent::save();
 
-        if (!ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            $sql = "UPDATE  wcf" . WCF_N . "_application
-                    SET     domainName = ?,
-                            cookieDomain = ?";
-            $statement = WCF::getDB()->prepareStatement($sql);
-            $statement->execute([
-                $this->domainName,
-                $this->cookieDomain,
-            ]);
-        }
+        $sql = "UPDATE  wcf" . WCF_N . "_application
+                SET     domainName = ?,
+                        cookieDomain = ?";
+        $statement = WCF::getDB()->prepareStatement($sql);
+        $statement->execute([
+            $this->domainName,
+            $this->cookieDomain,
+        ]);
 
         $sql = "UPDATE  wcf" . WCF_N . "_application
                 SET     landingPageID = ?
@@ -231,7 +219,6 @@ final class ApplicationManagementForm extends AbstractForm
             'applicationList' => $this->applicationList,
             'cookieDomain' => $this->cookieDomain,
             'domainName' => $this->domainName,
-            'isMultiDomainSetup' => ApplicationHandler::getInstance()->isMultiDomainSetup(),
             'pageNodeList' => $this->pageNodeList,
             'pageList' => $pageList->getObjects(),
         ]);
index 1d593a1f04feee4618724cd486cb18d6b8112020..924f3c92e41278a7831ba13e0e6e724103bb3809 100644 (file)
@@ -1183,14 +1183,6 @@ class WCF
     {
         if (!ENABLE_DESKTOP_NOTIFICATIONS) {
             return false;
-        } elseif (ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            $application = ApplicationHandler::getInstance()->getApplicationByID(1);
-
-            $currentApplication = ApplicationHandler::getInstance()->getActiveApplication();
-            if ($currentApplication->domainName != $application->domainName) {
-                // different domain
-                return false;
-            }
         }
 
         return true;
index 5dbcb3f313df7c08fbdf60e84baf4ddba80d1fdb..77f5a1a1c88e308ca33e29d13ad4c31a8e610222 100644 (file)
@@ -92,10 +92,7 @@ class RequestHandler extends SingletonFactory
 
             $this->checkOfflineMode();
 
-            if (
-                $this->isACPRequest()
-                && !ApplicationHandler::getInstance()->isMultiDomainSetup()
-            ) {
+            if ($this->isACPRequest()) {
                 \header('referrer-policy: same-origin');
                 \header('cross-origin-opener-policy: same-origin');
                 \header('cross-origin-resource-policy: same-site');
index b71e9fdf80a86cbb9da808cf5e5c84bc9335245b..13142222c9a63f34145827b4c87d46c9b566fbb0 100644 (file)
@@ -8,7 +8,6 @@ use wcf\data\session\SessionEditor;
 use wcf\data\style\StyleAction;
 use wcf\data\user\User;
 use wcf\data\user\UserEditor;
-use wcf\system\application\ApplicationHandler;
 use wcf\system\cache\builder\SpiderCacheBuilder;
 use wcf\system\cache\builder\UserGroupOptionCacheBuilder;
 use wcf\system\cache\builder\UserGroupPermissionCacheBuilder;
@@ -489,25 +488,15 @@ final class SessionHandler extends SingletonFactory
             //    and it is supported by default in common JavaScript frameworks.
             // 2) We want to set the SameSite=lax parameter.
             // 3) We don't want the HttpOnly parameter.
-            $sameSite = $cookieDomain = '';
 
-            if (ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-                // We need to specify the cookieDomain in a multi domain set-up, because
-                // otherwise no cookies are sent to subdomains.
-                $cookieDomain = HeaderUtil::getCookieDomain();
-                $cookieDomain = ($cookieDomain !== null ? '; domain=' . $cookieDomain : '');
-            } else {
-                // SameSite=lax is not supported in a multi domain set-up, because
-                // it breaks cross-application requests.
-                $sameSite = '; SameSite=lax';
-            }
+            $sameSite = '; SameSite=lax';
 
             if (!HTTP_SEND_X_FRAME_OPTIONS) {
                 $sameSite = '; SameSite=none';
             }
 
             \header(
-                'set-cookie: XSRF-TOKEN=' . \rawurlencode($xsrfToken) . '; path=/' . $cookieDomain . (RouteHandler::secureConnection() ? '; secure' : '') . $sameSite,
+                'set-cookie: XSRF-TOKEN=' . \rawurlencode($xsrfToken) . '; path=/' . (RouteHandler::secureConnection() ? '; secure' : '') . $sameSite,
                 false
             );
         }
index d465453dfb442a81a67e7a073c9b08ad2aa2b57e..5ed839f0d68e5f5dfcf0468261dfdf132ec2fbb1 100644 (file)
@@ -523,26 +523,18 @@ final class StyleCompiler extends SingletonFactory
             }
 EOT;
 
-        if (ApplicationHandler::getInstance()->isMultiDomainSetup()) {
-            $content .= <<<'EOT'
-                @function getFont($filename, $family: "/", $version: "") {
-                    @return "../font/getFont.php?family=" + $family + "&filename=" + $filename + "&v=" + $version;
+        $content .= <<<'EOT'
+            @function getFont($filename, $family: "/", $version: "") {
+                @if ($family != "") {
+                    $family: "families/" + $family + "/";
                 }
-EOT;
-        } else {
-            $content .= <<<'EOT'
-                @function getFont($filename, $family: "/", $version: "") {
-                    @if ($family != "") {
-                        $family: "families/" + $family + "/";
-                    }
-                    @if ($version != "") {
-                        $version: "?v=" + $version;
-                    }
-                    
-                    @return "../font/" + $family + $filename + $version;
+                @if ($version != "") {
+                    $version: "?v=" + $version;
                 }
+                
+                @return "../font/" + $family + $filename + $version;
+            }
 EOT;
-        }
 
         if (!empty($variables['wcfFontFamilyGoogle'])) {
             $content .= $this->getGoogleFontScss($variables['wcfFontFamilyGoogle']);
index b23d22676f95e1475128ad4915350a0ad65ceb01..d539a96fdeb1dd01f2dc8390da9345e82fd081f8 100644 (file)
                <item name="wcf.acp.application.landingPage.default"><![CDATA[(Standard)]]></item>
                <item name="wcf.acp.application.landingPage.description"><![CDATA[Optional: {if LANGUAGE_USE_INFORMAL_VARIANT}Gib{else}Geben Sie{/if} die Seite an, die angezeigt wird, wenn diese App direkt aufgerufen wird.]]></item>
                <item name="wcf.acp.application.list"><![CDATA[Installierte Apps]]></item>
-               <item name="wcf.acp.application.multiDomain"><![CDATA[<p style="font-size: 18px">Die Unterstützung für Installationen mit mehreren Domains wird eingestellt.</p>
-<p><br></p>
-<p>Es wird dringend empfohlen die Apps auf eine gemeinsame Domain zu verschieben, bitte passen Sie dazu die Domain- und Pfadkonfiguration der installierten Apps an:</p>
-<ul class="nativeList">
-       {foreach from=$applicationList item=application}
-               <li><a href="{link controller='ApplicationEdit' id=$application->packageID}{/link}">{$application->getPackage()->getName()}</a></li>
-       {/foreach}
-</ul>]]></item>
                <item name="wcf.acp.application.management.domain"><![CDATA[Domain-Konfiguration]]></item>
                <item name="wcf.acp.application.management.domainName"><![CDATA[Domain]]></item>
                <item name="wcf.acp.application.management.domainName.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Gib{else}Geben Sie{/if} den Domain-Namen ohne Protokoll und Pfad ein, beispielsweise „www.example.com“.]]></item>
@@ -5565,5 +5557,6 @@ Benachrichtigungen auf <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phra
 <delete>
        <item name="wcf.acp.option.desktop_notification_package_id"/>
        <item name="wcf.acp.option.desktop_notification_package_id.description"/>
+       <item name="wcf.acp.application.multiDomain"/>
 </delete>
 </language>
index 9a7355b3a3bf4da49ae1b91f76705716f26cf5f2..6795efaed8bf656918ee8ce56650403aa28157ff 100644 (file)
                <item name="wcf.acp.application.landingPage.default"><![CDATA[(Default)]]></item>
                <item name="wcf.acp.application.landingPage.description"><![CDATA[Optional: This page will be shown when a user is navigating to this app.]]></item>
                <item name="wcf.acp.application.list"><![CDATA[Installed Applications]]></item>
-               <item name="wcf.acp.application.multiDomain"><![CDATA[<p style="font-size: 18px">The support for setups with multiple domains is discontinued.</p>
-<p><br></p>
-<p>It is strongly recommended to consolidate all apps on a shared domain, please adjust the domain and path settings for these apps:</p>
-<ul class="nativeList">
-       {foreach from=$applicationList item=application}
-               <li><a href="{link controller='ApplicationEdit' id=$application->packageID}{/link}">{$application->getPackage()->getName()}</a></li>
-       {/foreach}
-</ul>]]></item>
                <item name="wcf.acp.application.management.domain"><![CDATA[Domain Configuration]]></item>
                <item name="wcf.acp.application.management.domainName"><![CDATA[Domain]]></item>
                <item name="wcf.acp.application.management.domainName.description"><![CDATA[Provide the domain name excluding any protocol or path, for example “www.example.com”.]]></item>
@@ -5567,5 +5559,6 @@ your notifications on <a href="{link isHtmlEmail=true}{/link}">{PAGE_TITLE|phras
 <delete>
        <item name="wcf.acp.option.desktop_notification_package_id"/>
        <item name="wcf.acp.option.desktop_notification_package_id.description"/>
+       <item name="wcf.acp.application.multiDomain"/>
 </delete>
 </language>