diff options
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/registration.class.php | 2 | ||||
-rw-r--r-- | lib/class/user.class.php | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/class/registration.class.php b/lib/class/registration.class.php index 7b3f344c..24015dc7 100644 --- a/lib/class/registration.class.php +++ b/lib/class/registration.class.php @@ -60,7 +60,7 @@ class Registration { if (Config::get('admin_notify_reg')) { $body = "A new user has registered\n\n" . "The following values were entered.\n\n" . - "Username:$username\nFullname:$fullname\nE-mail:$mail\n\n"; + "Username:$username\nFullname:$fullname\nE-mail:$email\n\n"; mail(Config::get('mail_from'),$subject,$body,$headers); } diff --git a/lib/class/user.class.php b/lib/class/user.class.php index 1755aa11..9f4e6715 100644 --- a/lib/class/user.class.php +++ b/lib/class/user.class.php @@ -546,8 +546,14 @@ class User { * address at this time in this place, doing this thing.. you get the point */ public function insert_ip_history() { - - $ip = ip2int($_SERVER['REMOTE_ADDR']); + if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ + $sip = $_SERVER['HTTP_X_FORWARDED_FOR']; + debug_event('User Ip', 'Login from ip adress: ' . $sip,'3'); + } else { + $sip = $_SERVER['REMOTE_ADDR']; + debug_event('User Ip', 'Login from ip adress: ' . $sip,'3'); + } + $ip = ip2int($sip); $date = time(); $user = $this->id; @@ -1000,10 +1006,10 @@ class User { */ function activate_user($username) { - $username = sql_escape($username); + $username = Dba::escape($username); $sql = "UPDATE user SET disabled='0' WHERE username='$username'"; - $db_results = mysql_query($sql, dbh()); + $db_results = Dba::query($sql); } // activate_user @@ -1033,7 +1039,7 @@ class User { */ public static function check_username($username) { - $usrename = Dba::escape($username); + $username = Dba::escape($username); $sql = "SELECT `id` FROM `user` WHERE `username`='$username'"; $db_results = Dba::query($sql); |