From: Marcel Werk Date: Thu, 19 May 2016 19:46:01 +0000 (+0200) Subject: Fixed disabling of static cms pages X-Git-Tag: 3.0.0_Beta_1~1708 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=323769137cd735b80e44ee95fec8453ac6d855ed;p=GitHub%2FWoltLab%2FWCF.git Fixed disabling of static cms pages --- 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();