This topic is locked

enhanced system access lock

1/1/2009 5:25:56 PM
PHPRunner General questions
hichem author

How can I add the user to this solution to only block the user+IP address and not block all the users using the same IP.

Basically I woudl like to block only the user and not the IP address or if it makes more sense block the user with the IP so blocked users still get a chance to login from another PC.

The below tip available on the site only shows how to block the IP address. I am new to this and yet have to find the session variable for the user and see how it can be done. Anyone has already done this?
http://www.xlinesoft.com/articles/system_access_lock.htm
Also has anyone created some kind of audit trail for changes to the tables/fields? meaning I would like to log the username with every action into some kind of a log table, so I guess need to insert the username, object and action if these are all vailable as session variables.

I guess I have to use an event as well?

May be someone has done this before?
Many thanks and happy new year <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=10525&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />
Hich
PHPRunner rocks!

J
Jane 1/5/2009

Hi,
just add new field to the LoginAttempts table, save entered username is this field and then check IP address and username in the Before login event.

Here is just a sample:

...

$sql = "select Attempts, LastLogin from LoginAttempts where ip = '" . $_SERVER["REMOTE_ADDR"] . "'and UserName='".$username."'";

...

db_exec("update LoginAttempts set Attempts=0 where ip = '" . $_SERVER["REMOTE_ADDR"] . "'and UserName='".$username."'",$conn);

...