Minor display cleanup
[mirrors/Kyberia-bloodline.git] / wwwroot / backend / mysql / backend.inc
index 560c5b8f9f845aa0b6aa1aa8adeb6e7bf25c82d8..554ba63c37358dc693def85738493c7f5443d1a6 100644 (file)
@@ -705,17 +705,20 @@ 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) {
+       if ($login_id == 0) {
                $set=$db->query("select * from users where login='$login'");
        } else {
-               $set=$db->query("select * from users where user_id='$login'");
+               $set=$db->query("select * from users where user_id='$login_id'");
        }
 
        $set->next();
@@ -725,15 +728,30 @@ 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);
+       
+       $error="OK, password was RE-set";
+       return $error;
+}
 
-       return 0;
+// levenshteinLog
+
+// Log user action for later analysis
+// Secure.
+
+public static function levenshteinLog($userid,$nodeid) {
+       global $db;
+
+       $q="insert delayed into levenshtein set user_id='".$userid."',node_id='".$node_id."'";
+       $db->update($q);
+       
 }
 
+
 }
 ?>
This page took 0.158955 seconds and 4 git commands to generate.