-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresetPassword.php
More file actions
97 lines (78 loc) · 3.26 KB
/
Copy pathresetPassword.php
File metadata and controls
97 lines (78 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
include_once "includes/db.php";
if (!isset($_GET['token'])) {
header("Location: index.php");
exit;
}
$token = $_GET['token'];
$sql = "SELECT * FROM `users` WHERE `user_reset_token` = ?";
$result = query($conn, $sql, [$token]);
if (empty($result) || $current_timestamp >= $result[0]['user_reset_token_expire']) {
header("Location: forgotPassword.php?token=invalid");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RESET PASSWORD - LNHS Research Hub</title>
<link rel="icon" href="./assets/icons/LNHS-icon.png" type="image/png">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/mainStyle.css">
<link rel="stylesheet" href="css/bgStyle.css">
<style>
.login-card {
width: 100%;
max-width: 500px;
}
</style>
</head>
<body>
<!-- Header -->
<?php
include './includes/header.php';
?>
<main>
<!-- Login Section -->
<div class="container d-flex justify-content-center align-items-center">
<div class="card login-card">
<div class="card-body p-4">
<h3 class="login_card-title text-center mb-4">Reset Password</h3>
<form id="resetPasswordForm" action="backend/reset_password.php" method="POST">
<input type="text" class="form-control" name="token" required hidden value="<?php echo $_GET['token']; ?>">
<!-- Password and Confirm Password -->
<div class="row mb-3">
<div class="col-md-12">
<label for="password" class="form-label required">Enter your new password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
</div>
<div class="row mb-3">
<div class="col-md-12">
<label for="confirmPassword" class="form-label required">Confirm your new password</label>
<input type="password" class="form-control" id="confirmPassword" name="confirmPassword" required>
</div>
</div>
<div class="d-grid mt-5">
<button type="submit" class="btn btn-primary">Reset Password</button>
</div>
</form>
</div>
</div>
</div>
</main>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="includes/functions.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
confirmPassword('resetPasswordForm');
handleStatus('reset');
});
</script>
</body>
</html>