add forget password

This commit is contained in:
Thanakorn S
2026-05-12 17:19:22 +07:00
parent 8f1c5c49fd
commit 79e66bd354
5 changed files with 286 additions and 2 deletions
+2 -2
View File
@@ -349,7 +349,7 @@ if (password_verify(trim($data["password"]), $temp["password"])) {
// don't count so a typo in your own name doesn't eat your own attempts.
if ($user_id) {
$attempts = (int)($temp['login_attempts'] ?? 0) + 1;
if ($attempts >= 10) {
if ($attempts >= 5) {
$locked_until = date('Y-m-d H:i:s', strtotime('+30 minutes'));
$pdo1->prepare("UPDATE user SET login_attempts = :a, locked_until = :l WHERE user_id = :id")
->execute([':a' => $attempts, ':l' => $locked_until, ':id' => $user_id]);
@@ -361,7 +361,7 @@ if (password_verify(trim($data["password"]), $temp["password"])) {
$answer['message'] = "Incorrect Password";
}
} else {
$answer['message'] = "Incorrect Password";
$answer['message'] = "Incorrect Username";
}
setcookie("u", "", time() - 1, "/");