From: niekt0 Date: Thu, 12 Jan 2012 08:58:40 +0000 (+0100) Subject: reset_password fix X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=71a598e9ace080c3a636a39cc110e1ed169a1a4e;p=mirrors%2FKyberia-bloodline.git reset_password fix --- diff --git a/wwwroot/backend/mysql/backend.inc b/wwwroot/backend/mysql/backend.inc index 560c5b8..4bdcc8c 100644 --- a/wwwroot/backend/mysql/backend.inc +++ b/wwwroot/backend/mysql/backend.inc @@ -705,11 +705,14 @@ public static function resetPassword($login_id,$login,$vercode,$password) { // Security checks $login = db_escape_string($login); - if (!is_numeric($login_id)) { return false; } + if (!is_numeric($login_id)) { + $error="Not numeric id is not numeric. Here, take this stone."; + return $error; + } if ($login == '') { $error="Please enter name or id"; - return false; + return $error; } if ($login_id = 0) { @@ -725,14 +728,15 @@ public static function resetPassword($login_id,$login,$vercode,$password) { if ($hash != $vercode) { $error="Bad verification code!"; - return false; + return $error; } $password = sha1($password); $q="update users set password='$password',hash='' where user_id='$user_id'"; $db->query($q); - - return 0; + + $error="OK, password was RE-set"; + return $error; } } diff --git a/wwwroot/inc/eventz/reset_password.inc b/wwwroot/inc/eventz/reset_password.inc index 883b7b8..3c5f205 100644 --- a/wwwroot/inc/eventz/reset_password.inc +++ b/wwwroot/inc/eventz/reset_password.inc @@ -29,8 +29,8 @@ function reset_password() { $login_id=0; } $error=nodes::resetPassword($login_id,$login,$vercode,$password1); + print "$error\n"; - $error="Password changed. Now you can login with your new password."; return 0; } ?>