reset_password fix
authorniekt0 <niekt0@kyberia.cz>
Thu, 12 Jan 2012 08:58:40 +0000 (09:58 +0100)
committerniekt0 <niekt0@kyberia.cz>
Thu, 12 Jan 2012 08:58:40 +0000 (09:58 +0100)
wwwroot/backend/mysql/backend.inc
wwwroot/inc/eventz/reset_password.inc

index 560c5b8f9f845aa0b6aa1aa8adeb6e7bf25c82d8..4bdcc8c0d8568f5455ae9bb9847e338708f93b7b 100644 (file)
@@ -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;
 }
 
 }
index 883b7b86b75b5e59be1e006a6805aea9b631e927..3c5f205ce43c5a58c3c4f2cef3f7d8c8e9a5251b 100644 (file)
@@ -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;
 }
 ?>
This page took 0.153371 seconds and 4 git commands to generate.