如果输入错误密码超过3次,如何锁定用户24小时 [英] how to lock the user for 24 hrs if he entered wrong password for more than 3 times

查看:216
本文介绍了如果输入错误密码超过3次,如何锁定用户24小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果输入错误的密码超过3次,如何锁定用户几个小时..

解决方案

嗯...没有。



没有人会为你写这个项目。而且我认为没有人想写一些非常大的文章来涵盖你需要知道的所有内容。


你完全将问题改为无关的问题原来的。请不要这样做!



现在,您的评论和答案已经过时,根本不符合您最初发布的内容。


< blockquote>在您的数据库中,您必须跟踪上次登录尝试和不成功尝试的次数。当您达到一定数量的失败尝试时,您可以在用户记录中设置一个标记字段,表示该帐户已被锁定,另一个字段用于锁定何时到期。



当然,当用户尝试再次登录并采取适当的行动时,您必须在身份验证例程中编写代码以检查这些值。


How to lock the user for some hours if he entered the wrong password for more than 3 times..

解决方案

Ummm... no.

No one is going to write this project for you. And I don't think anyone wants to write a few very large articles to cover everything that you're going to need to know to do this.


You completely changed the question to something unrelated to the original. DO NOT DO THAT!

This now makes the comments and answer you got obsolete, not matching at all what you originally posted.


In your database, you have to keep track of the last login attempt and the number of unsuccessful attempts. When you reach a set number of failed attempts, you can set a flag field in your user record that says the account is locked and another field for when the lock should expire.

You will, of course, have to write code in your authentication routine to check for these values when the user tries to login again and act appropriately.


这篇关于如果输入错误密码超过3次,如何锁定用户24小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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