开发者

How to deny user access to Paginator sort?

Is there a way to prevent user accessing sort:field url if I use paginator? I want deny sorting because I got millions of rows and it's really slow sorting unindexe开发者_StackOverflow中文版d fields.


Simply remove the paginator link in the view. So instead of <th><?php echo $this->Paginator->sort('name');?></th> just use <th>Name</th>

The users can still sort by name, but as long as it's not a security issue, it's fine.

If you really need to prevent sorting on particular columns, or allow only on some columns, filter $this->params['url'] and $this->passedArgs (you have to remove from both of them)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜