-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathpassword_reset_change.php
86 lines (39 loc) · 1.19 KB
/
password_reset_change.php
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
<?php
include("code/includes.php");
if( isset($_REQUEST['username']) ) {
$this_user = new User();
$this_user->getAttr($_REQUEST['username'], "username");
if( md5($this_user->password) == $_REQUEST['password_hash'] ) {
$user_found_with_password = true;
} else {
$user_found_with_password = false;
}
}
?>
<html>
<head>
<title>Change Your Password</title>
<?php include("parts/includes.php"); ?>
</head>
<body>
<?php include("parts/header.php"); ?>
<div class="mainContainer">
<h2>Password Reset</h2>
<?php
if( $user_found_with_password ) { ?>
<p>Please enter and confirm your password below:</p>
<form method="post" action="/password_reset/action">
<input type="hidden" value="<?=$_REQUEST['username']?>" name="username" / >
<input type="hidden" value="<?=$_REQUEST['password_hash']?>" name="password_hash" / >
<p><b>Password:</b> <input type="password" size="15" name="password" / ></p>
<p><b>Confirm Password:</b> <input type="password" size="15" name="password_2" / ></p>
<p><input type="submit" name="submit" value="Change Password" />
</form>
<?php } else { ?>
<p>Account not found.</p>
<?php }
?>
</div>
<?php include("parts/footer.php"); ?>
</body>
</html>