Exemplo n.º 1
0
 /**
  * judge can report post
  *
  * @param  Object  $oMbqEtForumPost
  * @return  Mixed
  */
 public function canAclReportPost($oMbqEtForumPost = null)
 {
     if (empty($oMbqEtForumPost) || !MbqMain::hasLogin()) {
         return false;
     }
     try {
         $reportAction = new ModerationQueueReportAction(array(), 'prepareReport', array('objectID' => $oMbqEtForumPost->postId->oriValue, 'objectType' => 'com.woltlab.wbb.post'));
         $reportAction->validateAction();
         $reportAction->executeAction();
         $returnValues = $reportAction->getReturnValues();
     } catch (\Exception $e) {
         return $e->getMessage();
     }
     if ($returnValues['returnValues']['alreadyReported'] == 1) {
         return WCF::getLanguage()->get('wcf.moderation.report.alreadyReported');
     }
     return true;
 }
Exemplo n.º 2
0
 /**
  * report forum post
  *
  * @param $oMbqEtForumPost
  * @param $reason
  */
 public function reportPost($oMbqEtForumPost, $reason)
 {
     $reportAction = new ModerationQueueReportAction(array(), 'report', array('objectID' => $oMbqEtForumPost->postId->oriValue, 'message' => $reason, 'objectType' => 'com.woltlab.wbb.post'));
     $reportAction->executeAction();
     return true;
 }