Improved the code / Cleanup
authorAlexander Ebert <ebert@woltlab.com>
Mon, 3 May 2021 10:37:52 +0000 (12:37 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 3 May 2021 10:37:52 +0000 (12:37 +0200)
wcfsetup/install/files/acp/templates/applicationManagement.tpl
wcfsetup/install/files/acp/update_com.woltlab.wcf_5.4_removeFiles.php
wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php
wcfsetup/install/files/lib/acp/form/ApplicationManagementForm.class.php

index 87e4e41a7ebbce5a778de016be38aacd67c6046b..c1e19fda84c5d7b4279f74e6225f0d456d9b50ca 100644 (file)
@@ -27,7 +27,7 @@
                                <dt><label for="domainName">{lang}wcf.acp.application.management.domainName{/lang}</label></dt>
                                <dd>
                                        <div class="inputAddon">
-                                               <span class="inputPrefix">http(s)://</span>
+                                               <span class="inputPrefix">https://</span>
                                                <input type="text" name="domainName" id="domainName" value="{$domainName}" class="long">
                                        </div>
                                        {if $errorField == 'domainName'}
                        </dl>
                </section>
 
-               <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");
 
-                               // Keep the cookie domain in sync if it was previously identical.
-                               if (domainName.value === cookieDomain.value) {
                                        domainName.addEventListener("input", () => {
                                                cookieDomain.value = domainName.value;
                                        });
-                               }
-                       })();
-               </script>
+                               })();
+                       </script>
+               {/if}
        {/if}
 
        <section class="section">
index a19137bd0e715c6804ef85e1a0a4670b492b250b..e50e9c1d5973e45804990f3f6bcedcd66baabd2f 100644 (file)
@@ -33,6 +33,7 @@ $files = [
     'acp/update_com.woltlab.wcf_5.3_packageServer.php',
     'acp/update_com.woltlab.wcf_5.3_preUpdate.php',
     'lib/acp/form/UserGroupPromoteOwnerForm.class.php',
+    'lib/acp/page/ApplicationManagementPage.class.php',
     'lib/system/database/table/DatabaseTableUtil.class.php',
 ];
 
index 2fce080e5ca46ed538c54f35376d9f5d7d16453f..5de2feb987bd2268075a66655311bd946d33a6d6 100644 (file)
@@ -17,7 +17,6 @@ use wcf\system\exception\UserInputException;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
-use wcf\util\HeaderUtil;
 use wcf\util\StringUtil;
 
 /**
index 29ed4750077e95efecc067feb22af68b6944e4b1..f9c8e0a520c895468a8c6642edc9d05f6decaac2 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace wcf\acp\form;
 
-use Stripe\Exception\PermissionException;
 use wcf\data\application\ViewableApplicationList;
 use wcf\data\page\Page;
 use wcf\data\page\PageList;
@@ -11,6 +10,7 @@ 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\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\Regex;
 use wcf\system\WCF;
@@ -26,7 +26,7 @@ use wcf\util\StringUtil;
  * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package WoltLabSuite\Core\Acp\Form
  */
-class ApplicationManagementForm extends AbstractForm
+final class ApplicationManagementForm extends AbstractForm
 {
     /**
      * @inheritDoc
@@ -100,7 +100,7 @@ class ApplicationManagementForm extends AbstractForm
         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 PermissionException();
+                throw new PermissionDeniedException();
             }
         }
 
@@ -192,8 +192,8 @@ class ApplicationManagementForm extends AbstractForm
             (new Page($this->landingPageID[1]))->setAsLandingPage();
         } else {
             $sql = "UPDATE  wcf" . WCF_N . "_page
-                        SET     isLandingPage = ?
-                        WHERE   isLandingPage = ?";
+                    SET     isLandingPage = ?
+                    WHERE   isLandingPage = ?";
             $statement = WCF::getDB()->prepareStatement($sql);
             $statement->execute([
                 0,