コード例 #1
0
 /**
  * @see Action::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get pm
     $this->pm = new PM($this->objectID);
     if (!$this->pm->pmID || !$this->pm->hasAccess()) {
         throw new IllegalLinkException();
     }
 }
コード例 #2
0
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     // get page number
     if (isset($_REQUEST['pmPageNo'])) {
         $this->pmPageNo = intval($_REQUEST['pmPageNo']);
     }
     // get pm id
     if (isset($_REQUEST['pmID'])) {
         $this->pmID = intval($_REQUEST['pmID']);
     }
     $this->pm = new PM($this->pmID);
     if (!$this->pm->pmID) {
         throw new IllegalLinkException();
     }
     if (!$this->pm->hasAccess()) {
         throw new PermissionDeniedException();
     }
     // init pm list
     $this->pmList = new PMList($this->pm);
     // go to message
     if ($this->pm->parentPmID && !isset($_REQUEST['pmPageNo'])) {
         $this->goToMessage();
     }
 }
 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     $attachment = $eventObj->attachment;
     if ($attachment['containerID'] && $attachment['containerType'] == 'pm') {
         if (!WCF::getUser()->userID) {
             throw new PermissionDeniedException();
         }
         require_once WCF_DIR . 'lib/data/message/pm/PM.class.php';
         $pm = new PM($attachment['containerID']);
         if (!$pm->hasAccess()) {
             throw new PermissionDeniedException();
         }
     }
 }