diff options
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/class/registration.class.php | 2 | ||||
-rw-r--r-- | lib/class/user.class.php | 16 | ||||
-rw-r--r-- | templates/show_user_activate.inc.php | 5 |
4 files changed, 17 insertions, 7 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index ad81a0e7..fcb21b05 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.4-Beta2 + - Fixed some minor glitches in user registration ( pb1dft ) - Fixed typo that caused mail to always mail to everyone. - Fixed an issue with user auth in XML API always registering as system (Thx purdyk) 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); diff --git a/templates/show_user_activate.inc.php b/templates/show_user_activate.inc.php index 0fc03d11..9a8fc15c 100644 --- a/templates/show_user_activate.inc.php +++ b/templates/show_user_activate.inc.php @@ -42,7 +42,10 @@ $web_path = Config::get('web_path'); <script src="<?php echo $web_path; ?>/modules/prototype/prototype.js" language="javascript" type="text/javascript"></script> <div id="maincontainer"> -<?php if ($validation == User::get_validation($username) AND strlen($validation)) { ?> +<?php + if ($validation == User::get_validation($username) AND strlen($validation)) { + User::activate_user($username); +?> <h3><?php echo _('User Activated'); ?></h3> <p> <?php echo _('This User ID is activated and can be used'); ?>. <a href="<?php echo Config::get('web_path'); ?>/login.php"><?php echo _('Login'); ?></a> |