From 323769137cd735b80e44ee95fec8453ac6d855ed Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Thu, 19 May 2016 21:46:01 +0200 Subject: [PATCH] Fixed disabling of static cms pages --- wcfsetup/install/files/lib/data/page/Page.class.php | 3 ++- wcfsetup/install/files/lib/page/CmsPage.class.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/page/Page.class.php b/wcfsetup/install/files/lib/data/page/Page.class.php index 48181a8104..4092791af6 100644 --- a/wcfsetup/install/files/lib/data/page/Page.class.php +++ b/wcfsetup/install/files/lib/data/page/Page.class.php @@ -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; diff --git a/wcfsetup/install/files/lib/page/CmsPage.class.php b/wcfsetup/install/files/lib/page/CmsPage.class.php index 608239c6b8..9485cd32e4 100644 --- a/wcfsetup/install/files/lib/page/CmsPage.class.php +++ b/wcfsetup/install/files/lib/page/CmsPage.class.php @@ -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(); -- 2.20.1