Prevent system-type pages from being copied
authorAlexander Ebert <ebert@woltlab.com>
Thu, 28 Nov 2019 21:40:59 +0000 (22:40 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 28 Nov 2019 21:40:59 +0000 (22:40 +0100)
wcfsetup/install/files/acp/templates/pageAdd.tpl
wcfsetup/install/files/lib/acp/form/PageAddForm.class.php

index 8e2aedf873ee6a43fdcc34a4de70b942b06580b0..d7f4c53b975a21626ae262daf91a26b8a540c180 100644 (file)
@@ -50,7 +50,7 @@
                        {/if}
                });
        </script>
-{else}
+{elseif $page->pageType !== 'system'}
        <script data-relocate="true">
                require(['Language', 'WoltLabSuite/Core/Acp/Ui/Page/Copy'], function (Language, AcpUiPageCopy) {
                        Language.addObject({
@@ -79,7 +79,9 @@
        <nav class="contentHeaderNavigation">
                <ul>
                        {if $action == 'edit'}
-                               <li><a href="#" class="button jsButtonCopyPage"><span class="icon icon16 fa-copy"></span> {lang}wcf.acp.page.button.copyPage{/lang}</a></li>
+                               {if $page->pageType !== 'system'}
+                                       <li><a href="#" class="button jsButtonCopyPage"><span class="icon icon16 fa-copy"></span> {lang}wcf.acp.page.button.copyPage{/lang}</a></li>
+                               {/if}
                                
                                {if !$page->requireObjectID}
                                        <li><a href="{$page->getLink()}" class="button"><span class="icon icon16 fa-search"></span> <span>{lang}wcf.acp.page.button.viewPage{/lang}</span></a></li>
index d970bd2e5d8d402a22602d690bbfbedd98030b55..1cdac321f9e00c5dec06acedbc703372140c0d99 100644 (file)
@@ -234,7 +234,7 @@ class PageAddForm extends AbstractForm {
                if (isset($_GET['presetPageID'])) $this->presetPageID = intval($_GET['presetPageID']);
                if ($this->presetPageID) {
                        $this->presetPage = new Page($this->presetPageID);
-                       if (!$this->presetPage->pageID) {
+                       if (!$this->presetPage->pageID || $this->presetPage->pageType === 'system') {
                                throw new IllegalLinkException();
                        }
                }