reset try catch

This commit is contained in:
xiaomlove
2025-10-30 11:29:00 +07:00
parent 3d5e316275
commit acb7df6d92

View File

@@ -39,7 +39,11 @@ $id = $arr['id'];
//$wantpasshash = md5($secret . $wantpassword . $secret);
//sql_query("UPDATE users SET passhash=".sqlesc($wantpasshash).", secret= ".sqlesc($secret)." where id=$id");
$userRep = new \App\Repositories\UserRepository();
$userRep->resetPassword($id, $newpassword, $newpasswordagain);
try {
$userRep->resetPassword($id, $newpassword, $newpasswordagain);
} catch (\Exception $e) {
stderr('Error', $e->getMessage());
}
write_log("Password Reset For $username by {$CURUSER['username']}");
if (mysql_affected_rows() != 1)
stderr("Error", "Unable to RESET PASSWORD on this account.");