summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/account.js8
-rw-r--r--template/en/default/account/prefs/account.html.tmpl9
-rw-r--r--template/en/default/account/prefs/prefs.html.tmpl6
3 files changed, 23 insertions, 0 deletions
diff --git a/js/account.js b/js/account.js
index d68c3f550..76b385437 100644
--- a/js/account.js
+++ b/js/account.js
@@ -42,6 +42,14 @@ $(function() {
$('#account_disable').val('');
});
+ // forgot password
+
+ $('#forgot-password')
+ .click(function(event) {
+ event.preventDefault();
+ $('#forgot-form').submit();
+ });
+
// mfa
$('#mfa-enable')
diff --git a/template/en/default/account/prefs/account.html.tmpl b/template/en/default/account/prefs/account.html.tmpl
index 919563440..bfae7f071 100644
--- a/template/en/default/account/prefs/account.html.tmpl
+++ b/template/en/default/account/prefs/account.html.tmpl
@@ -64,6 +64,7 @@
<td>
<input type="hidden" name="old_login" value="[% user.login FILTER html %]">
<input type="password" name="old_password">
+ <a href="#" id="forgot-password">I forgot my password</a>
</td>
</tr>
[% IF user.authorizer.can_change_password %]
@@ -147,3 +148,11 @@
</tr>
</table>
+
+[% tab_footer = BLOCK %]
+ <form action="token.cgi" method="post" id="forgot-form">
+ <input type="hidden" name="loginname" value="[% user.login FILTER html %]">
+ <input type="hidden" name="a" value="reqpw">
+ <input type="hidden" name="token" value="[% issue_hash_token(['reqpw']) FILTER html %]">
+ </form>
+[% END %]
diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl
index 853841bff..8d8f53beb 100644
--- a/template/en/default/account/prefs/prefs.html.tmpl
+++ b/template/en/default/account/prefs/prefs.html.tmpl
@@ -153,6 +153,12 @@
</form>
[% END %]
+[%
+ IF tab_footer;
+ tab_footer FILTER none;
+ END;
+%]
+
[% END %]
[% PROCESS global/footer.html.tmpl %]