问题
I have lot of AJAX functionality in my site and a component we freelanced was using CakePHP Security Component very tightly with the forms and this is lot of trouble.
How to disable Security Component site-wide in CakePHP? Just disabling it the app_controller.php is not helping because it is tightly coupled with some validation and black-hole stuff.
Any ideas?
回答1:
Even if you disable it in your app_controller your individual controller may have that security enabled.As my wild guess says this is what you want to do.If not let me know more about it.
function beforeFilter(){
parent::beforeFilter();
if(isset($this->Security) && $this->RequestHandler->isAjax() && $this->action = 'add'){
$this->Security->enabled = false;
}
}
you can read more about this here .Hope this will solve your problem
来源:https://stackoverflow.com/questions/9171227/cakephp-disable-security-component-site-wide