Fixed disabling of static cms pages
authorMarcel Werk <burntime@woltlab.com>
Thu, 19 May 2016 19:46:01 +0000 (21:46 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 19 May 2016 19:46:07 +0000 (21:46 +0200)
wcfsetup/install/files/lib/data/page/Page.class.php
wcfsetup/install/files/lib/page/CmsPage.class.php

index 48181a81043bf64a5d8367d3c307acb67adac113..4092791af6552da5e79a04931977b22e55dae13a 100644 (file)
@@ -91,7 +91,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject {
         * @return      boolean
         */
        public function canDisable() {
-               if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && !$this->originIsSystem && !$this->isLandingPage) {
+               if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && (!$this->originIsSystem || $this->pageType != 'system') && !$this->isLandingPage) {
                        return true;
                }
                
@@ -217,6 +217,7 @@ class Page extends DatabaseObject implements ILinkableObject, ITitledObject {
         * @return      boolean         false if the page should be hidden from menus
         */
        public function isVisible() {
+               if ($this->isDisabled) return false;
                if (!$this->validateOptions()) return false;
                if (!$this->validatePermissions()) return false;
                
index 608239c6b8a27e3a940de76c0b6b5ccf482c046a..9485cd32e4106c3a1a3556a934665c050dfb35e8 100644 (file)
@@ -65,6 +65,10 @@ class CmsPage extends AbstractPage {
                        throw new IllegalLinkException();
                }
                
+               if ($this->page->isDisabled && !WCF::getSession()->getPermission('admin.content.cms.canManagePage')) {
+                       throw new IllegalLinkException();
+               }
+               
                $this->content = $this->page->getPageContentByLanguage($this->languageID);
                if (empty($this->content)) {
                        throw new IllegalLinkException();