summaryrefslogtreecommitdiff
path: root/template/reset.st
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2010-04-29 03:11:35 -0400
committersostler <sbostler@gmail.com>2010-04-29 03:11:35 -0400
commit210d0294b59759c7cccd3d1f7408627cecc7f86a (patch)
tree1fa9a192f66d4c78de0e268b56acec5a6ad6f37a /template/reset.st
parent34869a3f8fb0ac6ed6c17db4a90e28c705829f0d (diff)
Password reset feature
Diffstat (limited to 'template/reset.st')
-rw-r--r--template/reset.st61
1 files changed, 61 insertions, 0 deletions
diff --git a/template/reset.st b/template/reset.st
new file mode 100644
index 0000000..f166d88
--- /dev/null
+++ b/template/reset.st
@@ -0,0 +1,61 @@
+<html>
+ <head>
+ <title>dump.fm Password Reset</title>
+ <script type="text/javascript" src="/static/js/sha1.js"></script>
+ $head()$
+ <style>
+ #main {
+ padding: 100px 2em 0px 2em;
+ }
+ label {
+ float: left;
+ width: 150px;
+ }
+ </style>
+ <script>
+ jQuery(function() {
+ jQuery("#submit").click(function() {
+ var p1 = jQuery('#p1').val();
+ var p2 = jQuery('#p1').val();
+ if (p1.length < 5) {
+ jQuery('#feedback').text("Password must be at least five letters long!").show();
+ jQuery('#p1, #p2').val("");
+ return false;
+ } else if (p1 != p2) {
+ jQuery('#feedback').text("Both passwords must match!").show();
+ jQuery('#p1, #p2').val("");
+ return false;
+ }
+ var nick = '$nick$';
+ var hash = hex_sha1(nick + '\$' + p1 + '\$dumpfm');
+ jQuery('#hash').val(hash);
+ return true;
+ });
+ });
+ </script>
+ </head>
+ <body>
+ $banner()$
+ <div id="main">
+ $if(valid_request)$
+ <div id="feedback" style="display: none; color: red; margin-bottom: 2em;"></div>
+ <h1>Reset Your Password</h1>
+ <br>
+ <label>New Password:</label>
+ <input type="password" id="p1">
+ <br>
+ <label>Repeat Password:</label>
+ <input type="password" id="p2">
+ <br>
+ <form action="$link$" method="POST">
+ <input type="hidden" value="hash" name="hash" id="hash">
+ <input type="submit" value="Change password" id="submit">
+ </form>
+ $else$
+ <h1>Bad Request</h1>
+ <span>Your password reset link is invalid or has expired. Please try
+ resetting again.</span>
+ $endif$
+ </div>
+ </body>
+</html>