diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2016-03-13 11:37:48 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2016-03-13 11:47:30 +0100 |
commit | 32c8d0c3f837950518f886ed9baef00e98740049 (patch) | |
tree | 59200bcb746be355d649915f28626e24fecf998f /web/lib | |
parent | 761952d424ded8848335116beef962c39c551bc4 (diff) | |
download | aurweb-32c8d0c3f837950518f886ed9baef00e98740049.tar.xz |
Store last login address as plain text
Directly store the information contained in $_SERVER['REMOTE_ADDR']
instead of using ip2long() which does not support IPv6 addresses. Note
that the LastLoginIPAddress field is designed to be used by the
administrator on rare occasions only (e.g. to fight spam) and is not
displayed anywhere.
Fixes FS#48557.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/acctfuncs.inc.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index b39420f..2d70f65 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -554,8 +554,8 @@ function try_login() { } $q = "UPDATE Users SET LastLogin = UNIX_TIMESTAMP(), "; - $q.= "LastLoginIPAddress = " . $dbh->quote(ip2long($_SERVER['REMOTE_ADDR'])) . " "; - $q.= "WHERE ID = '$userID'"; + $q.= "LastLoginIPAddress = " . $dbh->quote($_SERVER['REMOTE_ADDR']) . " "; + $q.= "WHERE ID = $userID"; $dbh->exec($q); /* Set the SID cookie. */ |