【问题标题】:how to print message for authentication in cakephp如何在cakephp中打印消息以进行身份​​验证
【发布时间】:2013-09-13 10:09:00
【问题描述】:

如何在 cakephp 中打印消息以进行身份​​验证

我在 beforeFilter() 中写了这个语句

 $this->Auth->authenticate = array(
                           'all'=>array(
                               'scope'=>array(
                                       'User.is_active'=>1
                                    )),
                               'Form');

但是当我使用正确的密码和电子邮件登录时,它们表示它们不匹配, 谁能告诉我应该做些什么修改才能让它运行。

【问题讨论】:

    标签: authentication cakephp-2.3


    【解决方案1】:

    beforeFileter 中添加这一行

    $this->Auth->authError = "Your Error";
    

    如果不想显示Error,写

    $this->Auth->authError = false;
    

    Go Ahead and read some documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-20
      • 1970-01-01
      • 1970-01-01
      • 2016-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多