コード例 #1
0
 /**
  * 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();
     }
 }
コード例 #2
0
 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 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();
     }
 }