summaryrefslogtreecommitdiffstats
path: root/lib/class/user.class.php
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2008-02-16 21:56:18 +0000
committerpb1dft <pb1dft@ampache>2008-02-16 21:56:18 +0000
commitb70a11b78bec4ed1bc2ace4f0358763d51c80693 (patch)
tree22614b9e46d4fe09c1699ea076c77c471468fe8a /lib/class/user.class.php
parent2e55ddf4988e94b2328529834e9baab219cb8856 (diff)
downloadampache-b70a11b78bec4ed1bc2ace4f0358763d51c80693.tar.gz
ampache-b70a11b78bec4ed1bc2ace4f0358763d51c80693.tar.bz2
ampache-b70a11b78bec4ed1bc2ace4f0358763d51c80693.zip
Fixed minor glitches in user registration
Diffstat (limited to 'lib/class/user.class.php')
-rw-r--r--lib/class/user.class.php16
1 files changed, 11 insertions, 5 deletions
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);