public function actionReport($cid = null, $fid = null, $tid = null, $pid = null)
    {
        $post = Post::verify($cid, $fid, $tid, $pid);
        if (empty($post)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the post you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if (User::can(Rbac::PERM_UPDATE_POST, ['item' => $post])) {
            $this->info(Yii::t('podium/flash', "You don't have to report this post since you are allowed to modify it."));
            return $this->redirect([
                'forum/edit',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'tid' => $post->thread->id,
                'pid' => $post->id
            ]);
        }

        if ($post->author_id == User::loggedId()) {
            $this->info(Yii::t('podium/flash', 'You can not report your own post. Please contact the administrator or moderators if you have got any concerns regarding your post.'));
            return $this->redirect([
                'forum/thread',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'id' => $post->thread->id,
                'slug' => $post->thread->slug
            ]);
        }

        $model = new Message();
        $model->scenario = 'report';
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if ($model->podiumReport($post)) {
                $this->success(Yii::t('podium/flash', 'Thank you for your report. The moderation team will take a look at this post.'));
                return $this->redirect([
                    'forum/thread',
                    'cid' => $post->forum->category->id,
                    'fid' => $post->forum->id,
                    'id' => $post->thread->id,
                    'slug' => $post->thread->slug
                ]);
            }
            $this->error(Yii::t('podium/flash', 'Sorry! There was an error while notifying the moderation team. Contact administrator about this problem.'));
        }
        return $this->render('report', ['model' => $model, 'post' => $post]);
    }
public function actionReport($cid = null, $fid = null, $tid = null, $pid = null)
    {
        $post = Post::verify($cid, $fid, $tid, $pid);
        if (empty($post)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find the post you are looking for.'));
            return $this->redirect(['forum/index']);
        }

        if (User::can(Rbac::PERM_UPDATE_POST, ['item' => $post])) {
            $this->info(Yii::t('podium/flash', "You don't have to report this post since you are allowed to modify it."));
            return $this->redirect([
                'forum/edit',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'tid' => $post->thread->id,
                'pid' => $post->id
            ]);
        }

        if ($post->author_id == User::loggedId()) {
            $this->info(Yii::t('podium/flash', 'You can not report your own post. Please contact the administrator or moderators if you have got any concerns regarding your post.'));
            return $this->redirect([
                'forum/thread',
                'cid' => $post->forum->category->id,
                'fid' => $post->forum->id,
                'id' => $post->thread->id,
                'slug' => $post->thread->slug
            ]);
        }

        $model = new Message();
        $model->scenario = 'report';
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if ($model->podiumReport($post)) {
                $this->success(Yii::t('podium/flash', 'Thank you for your report. The moderation team will take a look at this post.'));
                return $this->redirect([
                    'forum/thread',
                    'cid' => $post->forum->category->id,
                    'fid' => $post->forum->id,
                    'id' => $post->thread->id,
                    'slug' => $post->thread->slug
                ]);
            }
            $this->error(Yii::t('podium/flash', 'Sorry! There was an error while notifying the moderation team. Contact administrator about this problem.'));
        }
        return $this->render('report', ['model' => $model, 'post' => $post]);
    }
public function actionReport ( $ cid = null , $ fid = null , $ tid = null , $ pid = null ) { $ post = Post :: verify ( $ cid , $ fid , $ tid , $ pid ) ; if ( empty ( $ post ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find the post you are looking for.' ) ) ; return $ this -> redirect ( [ 'forum/index' ] ) ; } if ( User :: can ( Rbac :: PERM_UPDATE_POST , [ 'item' => $ post ] ) ) { $ this -> info ( Yii :: t ( 'podium/flash' , "You don't have to report this post since you are allowed to modify it." ) ) ; return $ this -> redirect ( [ 'forum/edit' , 'cid' => $ post -> forum -> category -> id , 'fid' => $ post -> forum -> id , 'tid' => $ post -> thread -> id , 'pid' => $ post -> id ] ) ; } if ( $ post -> author_id == User :: loggedId ( ) ) { $ this -> info ( Yii :: t ( 'podium/flash' , 'You can not report your own post. Please contact the administrator or moderators if you have got any concerns regarding your post.' ) ) ; return $ this -> redirect ( [ 'forum/thread' , 'cid' => $ post -> forum -> category -> id , 'fid' => $ post -> forum -> id , 'id' => $ post -> thread -> id , 'slug' => $ post -> thread -> slug ] ) ; } $ model = new Message ( ) ; $ model -> scenario = 'report' ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> validate ( ) ) { if ( $ model -> podiumReport ( $ post ) ) { $ this -> success ( Yii :: t ( 'podium/flash' , 'Thank you for your report. The moderation team will take a look at this post.' ) ) ; return $ this -> redirect ( [ 'forum/thread' , 'cid' => $ post -> forum -> category -> id , 'fid' => $ post -> forum -> id , 'id' => $ post -> thread -> id , 'slug' => $ post -> thread -> slug ] ) ; } $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! There was an error while notifying the moderation team. Contact administrator about this problem.' ) ) ; } return $ this -> render ( 'report' , [ 'model' => $ model , 'post' => $ post ] ) ; }
Reporting the post of given category ID, forum ID, thread ID, own ID and slug.
@param int $cid category ID
@param int $fid forum ID
@param int $tid thread ID
@param int $pid post ID
@return string|Response
Reporting the post of given category ID forum ID thread ID own ID and slug .