From 5660816ea079585c70583a9e470e22c4cf66c022 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Tue, 19 Mar 2013 14:49:34 +0100 Subject: Save last login IP address Save the IP address used for the last login in the "Users" table. This makes it a bit easier to create IP ban lists for spammers without looking at web server logs. Signed-off-by: Lukas Fleischer --- web/lib/acctfuncs.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'web') diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index b94c4c3..21cc6c2 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -444,7 +444,8 @@ function try_login() { } if ($logged_in) { - $q = "UPDATE Users SET LastLogin = UNIX_TIMESTAMP() "; + $q = "UPDATE Users SET LastLogin = UNIX_TIMESTAMP(), "; + $q.= "LastLoginIPAddress = " . $dbh->quote(ip2long($_SERVER['REMOTE_ADDR'])) . " "; $q.= "WHERE ID = '$userID'"; $dbh->exec($q); -- cgit v1.2.3-70-g09d2