This repository has been archived by the owner on Dec 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
resetpwd.php
74 lines (60 loc) · 1.53 KB
/
resetpwd.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
<?php
require_once("lib/init.php");
if (Member::IsLoggedIn())
header("Location: /directory");
?>
<!DOCTYPE html>
<html>
<head>
<title>Reset password — <?php echo SITE_NAME; ?></title>
<?php include("includes/head.php"); ?>
</head>
<body class="narrow">
<form method="post" action="/api/resetpwd">
<div class="text-center">
<a href="/">
<img src="<?php echo SITE_LARGE_IMG; ?>" alt="<?php echo SITE_NAME; ?>" class="logo-big">
</a>
<h1>Reset Password</h1>
<p>
Type your email address
below and you'll be sent a special link to reset
your password.
</p>
<input type="email" name="eml" placeholder="Email address" required>
<div class="text-right">
<button type="submit">Continue</button>
</div>
<br>
</div>
</form>
<?php include("includes/footer.php"); ?>
<script>
$(function()
{
$('input').first().focus();
// Reset pwd form submitted; sending email...
$('form').hijax({
before: function()
{
$('[type=submit]').showSpinner();
},
complete: function(xhr)
{
if (xhr.status == 200)
{
_gaq.push(['_trackEvent', 'Account', 'Submit Form', 'Request Reset']);
$.sticky("An email with instructions has been sent to you. <br>Redirecting in a few seconds...");
setTimeout(function() { window.location = '/' }, 5000);
}
else
{
$('[type=submit]').hideSpinner();
$.sticky(xhr.responseText || "There was an error. Please check your connection and try again.", { classList: 'error' });
}
}
});
});
</script>
</body>
</html>