Fix the return value of save_salt()

Return true if and only if the SQL query was executed successfully.
Logins with an unsalted password no longer fail now.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-08-08 11:32:06 +02:00
parent 0613a637b3
commit d61b34f255

View file

@ -471,7 +471,7 @@ function save_salt($user_id, $passwd) {
$hash = salted_hash($passwd, $salt); $hash = salted_hash($passwd, $salt);
$q = "UPDATE Users SET Salt = " . $dbh->quote($salt) . ", "; $q = "UPDATE Users SET Salt = " . $dbh->quote($salt) . ", ";
$q.= "Passwd = " . $dbh->quote($hash) . " WHERE ID = " . $user_id; $q.= "Passwd = " . $dbh->quote($hash) . " WHERE ID = " . $user_id;
$result = $dbh->exec($q); return $dbh->exec($q);
} }
/** /**