/** * @see PwPostAction.dataProcessing */ public function dataProcessing(PwPostDm $postDm) { $_gtime = $this->user->getPermission('post_modify_time'); $modifyTime = $_gtime && Pw::getTime() - $this->info['created_time'] > $_gtime * 60 ? Pw::getTime() : 0; $postDm->setDisabled($this->isDisabled())->setModifyInfo($this->user->uid, $this->user->username, $this->user->ip, $modifyTime); if (($postDm = $this->runWithFilters('dataProcessing', $postDm)) instanceof PwError) { return $postDm; } $this->postDm = $postDm; return true; }
/** * @see PwPostAction.dataProcessing */ public function dataProcessing(PwPostDm $postDm) { $postDm->setTid($this->tid)->setFid($this->forum->fid)->setAuthor($this->user->uid, $this->user->username, $this->user->ip)->setCreatedTime(Pw::getTime())->setDisabled($this->isDisabled()); if (($result = $this->checkContentHash($postDm->getContent())) !== true) { return $result; } if (($postDm = $this->runWithFilters('dataProcessing', $postDm)) instanceof PwError) { return $postDm; } $this->postDm = $postDm; return true; }
/** * @see PwPostAction.dataProcessing */ public function dataProcessing(PwPostDm $postDm) { $_gtime = $this->user->getPermission('post_modify_time'); $modifyTime = $_gtime && Pw::getTime() - $this->info['created_time'] > $_gtime * 60 ? Pw::getTime() : 0; $postDm->setDisabled($this->isDisabled())->setModifyInfo($this->user->uid, $this->user->username, $this->user->ip, $modifyTime); if (!Pw::getstatus($this->info['tpcstatus'], PwThread::STATUS_OPERATORLOG) && $this->info['created_userid'] != $this->user->uid) { $postDm->setOperatorLog(true); } if (($result = $this->checkTopictype($postDm)) !== true) { return $result; } if (($postDm = $this->runWithFilters('dataProcessing', $postDm)) instanceof PwError) { return $postDm; } $this->postDm = $postDm; return true; }
public function __construct($pid = 0, PwForumBo $forum = null, PwUserBo $user = null) { parent::__construct($forum, $user); $this->pid = $pid; }
public function checkTitle() { if ($this->_data['subject'] === '') { return new PwError('BBS:post.subject.empty'); } return parent::checkTitle(); }
/** * 检查主题分类 * * @param PwPostDm $postDm * @return bool|PwError */ public function checkTopictype(PwPostDm $postDm) { $topicType = $postDm->getTopictype(); if ($topicType && !$this->forum->forumset['topic_type']) { return new PwError('BBS:post.topictype.closed'); } if ($this->forum->forumset['topic_type'] && $this->forum->forumset['force_topic_type'] && !$postDm->getTopictype()) { $topicTypes = Wekit::load('SRV:forum.PwTopicType')->getTypesByFid($this->forum->fid); if ($topicTypes) { return new PwError('BBS:post.topictype.empty'); } } $permission = $this->user->getPermission('operate_thread'); if ($topicType && !$permission['type']) { $topicTypes or $topicTypes = Wekit::load('SRV:forum.PwTopicType')->getTypesByFid($this->forum->fid); if ($topicTypes[$topicType]['issys']) { return new PwError('BBS:post.topictype.admin'); } } return true; }