-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecover_password.php
54 lines (46 loc) · 1.62 KB
/
recover_password.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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Password Recovery</title>
<meta name="author" content="Tyler" />
<!-- Date: 2013-06-14 -->
</head>
<body>
<script src="sha256.js"></script>
<script src="core.js"></script>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
function onSubmit(){
var avail = $.ajax({
url: "check_user.php?email=" + document.info.email.value + "&username=f",
async: false,
type: 'get'
}).responseText;
if(avail == "false"){
document.getElementById('sent').innerHTML = 'An account at that email could not be found. Keep in mind: your email is case-sensitive';
}
else{
document.getElementById('sent').innerHTML = 'Email Sent. Note: Email was not sent if you have not already activated your account.';
var availa = $.ajax({
url: "create_recovery.php",
async: false,
type: 'POST',
data: 'email=' + document.info.email.value
}).responseText;
if(availa == 'sent'){
document.getElementById('sent').innerHTML = 'Password reset email has been sent';
}
else
document.getElementById('sent').innerHTML = 'This account has not yet been activated, and thus, you cannot change the password.';
}
}
</script>
<form name="info">
Enter your email: <input type="email" name="email"> <br />
<input type="button" name="submit" value="submit" onclick="onSubmit();"/>
<b id="sent"></b>
</form>
</body>
</html>