Welcome Guest, Not a member yet? Register   Sign In
Authentication and Blocking Login Attempts after 'n' tries
#1

[eluser]Glazz[/eluser]
Hey there,

I've created a basic authentication library, based on ion auth, it is more cleaner ( at least for me )..

And i added a feature to block a user after 'n' failed logins for let's say 30 minutes.

It is working fine, but i don't know if this is the best way to do this.

I was using sessions to store the ammount of failed login attempts, but then i switched to database.

Here are the code that i'm using:
http://pastebin.com/AWN72s4q

Here are the full code of the library:
http://pastebin.com/GciLbcNn

How it is working:

When a user press the login button if the login fails it calls the loginAttempt() function
If the user do this 3 times the next time he tries to login he gets blocked because the function isBlocked() is being called on the very top of the login() function.

My question is, do you think this is "effective" ? Or do you suggest something else ?

Thanks !


Messages In This Thread
Authentication and Blocking Login Attempts after 'n' tries - by El Forum - 05-08-2012, 02:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB