hi how do i change this code to limit user attempts to 3?
public void validateUser(String name, String password) {
if (name.equals("admin") && password.equals("letmein")) {
display.setCurrent(list1);
} else {
tryAgain();
}
}
public void tryAgain() {
Alert error = new Alert("Login Incorrect", "Please try again", null, AlertType.ERROR);
Many Thanks
limit login attempts
Started by frankietook, Aug 15 2010 12:53 AM
3 replies to this topic
#1
Posted 15 August 2010 - 12:53 AM
|
|
|
#2
Posted 15 August 2010 - 02:29 AM
I'm not that great at that area so I can't provide you with the code or something but sounds to me, like two loops one is while(true) and the other one is for loop limited with to three tries inside the while loop after wich comes a timer function (depending on how long you want to wait before it allows to try again).
#3
Posted 15 August 2010 - 04:36 AM
The way I do it is to track the number of attempts in a database, clearing the count on a successful login.
#4
Posted 15 August 2010 - 04:50 AM
yeah that's probably the best way, saw how much there is can go wrong with suggestion in my post but unfortunatly I can't delete it... hehe


Sign In
Create Account

Back to top









