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 unindexed fields.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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)