diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-21 21:37:43 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-06-21 21:37:43 +0000 |
commit | c78314791e6b84945f693720c33fcdf9a4ba324f (patch) | |
tree | 8d1ddcdc5e429c5b0acd4483a721f8c7387cdc83 /lib/class/user.class.php | |
parent | 71f0c05034660f97f92b07f3c39295c861427a47 (diff) | |
download | ampache-c78314791e6b84945f693720c33fcdf9a4ba324f.tar.gz ampache-c78314791e6b84945f693720c33fcdf9a4ba324f.tar.bz2 ampache-c78314791e6b84945f693720c33fcdf9a4ba324f.zip |
fixed the ip tracking stuff.. sorta
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r-- | lib/class/user.class.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 8806890b..ce014179 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -560,20 +560,19 @@ class User { * This inserts a row into the IP History recording this user at this * address at this time in this place, doing this thing.. you get the point */ - function insert_ip_history() { + public function insert_ip_history() { $ip = ip2int($_SERVER['REMOTE_ADDR']); $date = time(); $user = $this->id; - $sql = "INSERT INTO ip_history (`ip`,`user`,`date`) VALUES ('$ip','$user','$date')"; - $db_results = mysql_query($sql, dbh()); + $sql = "INSERT INTO `ip_history` (`ip`,`user`,`date`) VALUES ('$ip','$user','$date')"; + $db_results = Dba::query($sql); /* Clean up old records */ - $date = time() - (86400*conf('user_ip_cardinality')); - - $sql = "DELETE FROM ip_history WHERE `date` < $date"; - $db_results = mysql_query($sql,dbh()); + $date = time() - (86400*Config::get('user_ip_cardinality')); + $sql = "DELETE FROM `ip_history` WHERE `date` < $date"; + $db_results = Dba::query($sql); return true; |