-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathpassword_reset.php
85 lines (44 loc) · 1.44 KB
/
password_reset.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
<?php
include("parts/includes.php");
include("code/includes.php");
if( isset($_REQUEST['submit']) ) {
$this_user = new User();
$this_user->getAttr($_REQUEST['email'], "email");
if( $this_user->id > 0 ) {
$user_found = true;
} else {
$user_found = false;
}
if( $user_found ) {
$this_user->sendPasswordReset();
//sendMail($this_user->email, "[CACH] Password reset request", "Please reset your password by visiting this URL:\r\n\r\n " . $base_URL . "password_reset/" . $this_user->username . "/" . md5($this_user->password) . "\r\n\r\nThanks!\r\n\r\n - The ACH Bot");
}
}
?>
<html>
<head>
<title>ACH: Reset Your Password</title>
<?php include("parts/includes.php"); ?>
</head>
<body>
<?php include("parts/header.php"); ?>
<div class="mainContainer">
<h2>Forgotten Password Recovery</h2>
<?php
if( $user_found ) { ?>
<p>Okay — we've sent you an e-mail with instructions for reseting your password.</p>
<?php } else {
if( isset($_REQUEST['submit']) ) { ?>
<p class="error">Oops. We can't find that e-mail address in our system.</p>
<?php } ?>
<p>Please enter your e-mail address and we'll send you instructions for resetting your password.</p>
<form method="post" action="/password_reset/">
<p><b>E-mail address:</b> <input type="text" size="30" name="email" / ></p>
<p><input type="submit" name="submit" value="Send instructions..." />
</form>
<?php }
?>
</div>
<?php include("parts/footer.php"); ?>
</body>
</html>