检测蛋糕登录失败 [英] Detecting a failed login in Cake

查看:115
本文介绍了检测蛋糕登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!

我是比较新的CakePHP的,我对我的认证页面大部分工作现在。我想那会很酷,如果我能记录用户多少次登录失败,所以当一个登录认证失败我想知道是否有可能发现...

I'm relatively new to CakePHP and I'm mostly working on my authentication pages right now. I thought it'd be cool if I could record how many times a user failed to log in, so I was wondering if it was possible to detect when a login failed to authenticate...

有谁知道这是可能的吗?

Does anybody know if that's possible?

推荐答案

只是把这个逻辑到你的 UsersController ::登录功能:

Just put that logic into your UsersController::login function:

function login() {
    if ($this->data) { // login form was submitted
        if (!$this->Auth->user()) { // login failed
            // do something about it
        }
    }
}

这篇关于检测蛋糕登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆