禁用安全组件站点

禁用安全组件站点

本文介绍了CakePHP:禁用安全组件站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上有很多AJAX功能,我们自由使用的组件使用CakePHP安全组件与表单非常紧密,这很麻烦。

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.

在CakePHP中禁用站点范围的安全组件?只要禁用它,app_controller.php就不会帮助,因为它与一些验证和黑洞的东西紧密耦合。

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.

任何想法?

推荐答案

即使您在您的app_controller中禁用它,您的个人控制器可能已启用安全。我猜想说这是你想要做的。我更了解它。

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

这篇关于CakePHP:禁用安全组件站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 14:15