/** * @see \wcf\page\IPage::readParameters() */ public function readParameters() { parent::readParameters(); if (isset($_REQUEST['id'])) { $this->entryID = intval($_REQUEST['id']); } $this->entry = ViewableEntry::getEntry($this->entryID); if ($this->entry === null) { throw new IllegalLinkException(); } }
public function readParameters() { parent::readParameters(); if (!empty($_REQUEST['id'])) { $this->entryID = intval($_REQUEST['id']); } $this->entry = ViewableEntry::getEntry($this->entryID); if ($this->entry === null) { throw new IllegalLinkException(); } // check permissions if (!$this->entry->canRead()) { throw new PermissionDeniedException(); } }
/** * Validates the get entry preview action. */ public function validateGetEntryPreview() { $this->viewableEntry = ViewableEntry::getEntry(reset($this->objectIDs)); if ($this->viewableEntry === null || !$this->viewableEntry->canRead()) { throw new PermissionDeniedException(); } }