mirror of
https://github.com/gamaio/UnPS-API.git
synced 2024-12-22 02:02:40 +00:00
Fix HashPass input and sql update command on resetPass
This commit is contained in:
parent
b02ff148f9
commit
5aaec9e517
@ -378,11 +378,11 @@ class api{
|
|||||||
if(!$result = $udb->query($sql)) return 'ERROR: ['.$udb->error.']';
|
if(!$result = $udb->query($sql)) return 'ERROR: ['.$udb->error.']';
|
||||||
|
|
||||||
$iterations = mt_rand(11, 51);
|
$iterations = mt_rand(11, 51);
|
||||||
$password = explode("/", hashpass($password, NULL, $iterations));
|
$password = explode("/", hashpass($newpass, NULL, $iterations));
|
||||||
$salt = $password[1];
|
$salt = $password[1];
|
||||||
$password = $password[0];
|
$password = $password[0];
|
||||||
|
|
||||||
$sql = "UPDATE `logins` (password, salt, iterations) VALUES ('$password', '$salt', '$iterations') WHERE `email` = '$email';";
|
$sql = "UPDATE `logins` (`password`, `salt`, `iterations`) VALUES ('$password', '$salt', '$iterations') WHERE `email` = '$email';";
|
||||||
if(!$result = $udb->query($sql)) return 'ERROR: ['.$udb->error.']';
|
if(!$result = $udb->query($sql)) return 'ERROR: ['.$udb->error.']';
|
||||||
return "Password changed";
|
return "Password changed";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user