修复PostController.class.php中的BUG

个人中心允许越权查看他人报告 issued by niliu
This commit is contained in:
Martin Zhou
2016-01-25 15:36:23 +08:00
parent cccb3b6b6d
commit 99ec75a100

View File

@@ -77,8 +77,8 @@ class PostController extends BaseController
public function view(){ public function view(){
$id = session('userId'); $id = session('userId');
$rid = I('get.rid',0,'intval'); $rid = I('get.rid',0,'intval');
$model = M("Post"); $model = M("Post");
$post = $model->where('user_id='.$id)->where('id='.$rid)->find(); $post = $model->where(array('user_id'=>$id,'id'=>$rid))->find();
$tmodel= M('setting'); $tmodel= M('setting');
$title = $tmodel->where('id=1')->select(); $title = $tmodel->where('id=1')->select();
$this->assign('title', $title); $this->assign('title', $title);