mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
reset password update auth_key
This commit is contained in:
+3
-4
@@ -85,11 +85,10 @@ elseif($_SERVER["REQUEST_METHOD"] == "GET" && $take_recover && isset($_GET["id"]
|
||||
|
||||
$sec = mksecret();
|
||||
|
||||
// $newpasshash = md5($sec . $newpassword . $sec);
|
||||
$newpasshash = hash('sha256', $newpassword);
|
||||
$newpasshash = hash('sha256', $sec.$newpasshash);
|
||||
$newpasshash = hash('sha256', $sec.hash('sha256', $newpassword));
|
||||
$authKey = mksecret();
|
||||
|
||||
sql_query("UPDATE users SET secret=" . sqlesc($sec) . ", editsecret='', passhash=" . sqlesc($newpasshash) . " WHERE id=" . sqlesc($id)." AND editsecret=" . sqlesc($arr["editsecret"])) or sqlerr(__FILE__, __LINE__);
|
||||
sql_query("UPDATE users SET secret=" . sqlesc($sec) . ", editsecret='', passhash=" . sqlesc($newpasshash) . ", auth_key=". sqlesc($authKey) . " WHERE id=" . sqlesc($id)." AND editsecret=" . sqlesc($arr["editsecret"])) or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
if (!mysql_affected_rows())
|
||||
stderr($lang_recover['std_error'], $lang_recover['std_unable_updating_user_data']);
|
||||
|
||||
Reference in New Issue
Block a user