blob: 4089298adb0c359c8fd21f1ada95ef9b665c2b44 (
plain)
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
|
<html>
<head>
<title>dump.fm Password Reset</title>
$head()$
<style>
#main {
padding: 100px 2em 0px 2em;
}
label {
float: left;
width: 150px;
}
.error {
border: 1px solid red;
}
</style>
<script>
jQuery(function() {
jQuery("#submit").click(function() {
var nick = jQuery('#nick').val();
jQuery('#submit').attr('disabled', 'disabled');
if (!nick) {
jQuery('#nick').focus().addClass('error');
return;
}
var error = function(resp) {
var respText = resp.responseText ? resp.responseText.trim() : false;
if (respText == 'NO_NICK') {
alert('Sorry, no such user exists');
} else {
alert('Error sending request: ' + respText);
}
jQuery('#submit').removeAttr('disabled');
};
var success = function() {
alert('Email sent!');
location.href = "/";
};
jQuery.ajax({ type: 'POST',
timeout: 5000,
url: '/reset-request',
data: {'nick': nick },
success: success,
error: error });
});
});
</script>
</head>
<body>
$banner()$
<div id="main">
<div id="feedback" style="display: none; color: red; margin-bottom: 2em;"></div>
<h1>Forgot your password?</h1>
<br>
<div>
Enter your nick, and we'll send you an email to reset your password.
</div>
<br />
<label>Nick:</label>
<input type="text" id="nick">
<br />
<input type="submit" value="Reset password" id="submit">
</div>
</body>
</html>
|