summaryrefslogtreecommitdiffstats
path: root/lib/class/user.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r--lib/class/user.class.php13
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;