add forget password
This commit is contained in:
@@ -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, "/");
|
||||
|
||||
Reference in New Issue
Block a user