diff options
| author | sostler <sbostler@gmail.com> | 2010-04-29 03:11:35 -0400 |
|---|---|---|
| committer | sostler <sbostler@gmail.com> | 2010-04-29 03:11:35 -0400 |
| commit | 210d0294b59759c7cccd3d1f7408627cecc7f86a (patch) | |
| tree | 1fa9a192f66d4c78de0e268b56acec5a6ad6f37a /template | |
| parent | 34869a3f8fb0ac6ed6c17db4a90e28c705829f0d (diff) | |
Password reset feature
Diffstat (limited to 'template')
| -rw-r--r-- | template/debug.st | 29 | ||||
| -rw-r--r-- | template/mail/reset.st | 6 | ||||
| -rw-r--r-- | template/reset.st | 61 |
3 files changed, 93 insertions, 3 deletions
diff --git a/template/debug.st b/template/debug.st index c9bbcdb..bba203f 100644 --- a/template/debug.st +++ b/template/debug.st @@ -1,5 +1,4 @@ <html> - <head> <title>dump.fm DEBUG</title> $head()$ <style> @@ -17,7 +16,6 @@ width: 100px; } </style> - </head> <body> $banner()$ <div id="main"> @@ -47,7 +45,32 @@ <input type="submit" value="Send Email"> <input type="hidden" name="action" value="regemail"> <br> - <form/> + </form> + + <br><br><br><br> + + <form action="/debug" method="POST"> + <h1>Password Reset Email</h1> + <br> + <label>To:</label> + <input name="to" value="$user_email$"> + <br> + <label>Nick:</label> + <input name="nick" value="$user_nick$"> + <br> + <label>Template:</label> + <div> + $resettemps: { t | + <input type="radio" name="template" value="$t.template$" + $if(t.selected)$checked="checked"$endif$> $t.template$ + }$ + </div> + <br> + <input type="submit" value="Send Email"> + <input type="hidden" name="action" value="resetemail"> + <br> + </form> + </div> </body> </html> diff --git a/template/mail/reset.st b/template/mail/reset.st new file mode 100644 index 0000000..8112f90 --- /dev/null +++ b/template/mail/reset.st @@ -0,0 +1,6 @@ +SUBJECT: dump.fm Password Reset + +We're sorry you don't have your password, $nick$. Every moment +you're not dumping is a dagger in our hearts. + +Click <$link$> to get back into the game! 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> |
