/** * 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; }
/** * 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; }