From edf173722f9d14dd32cd8dba381ede5973b52a70 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Wed, 9 Mar 2016 00:02:39 +0530 Subject: Forgot Password facility Used django in-built views. Templates overridden. User enters email address and submits. The user receives an email with password reset link(one time link). The link contains a token generate using the current state of the user like user password. The link is verified each time when it is been requested. So the link will be invalid if the user has already changed the password using the link.(since the token is generated using current state of the user.) User resets his password via the link. --- .../templates/registration/password_reset_complete.html | 7 +++++++ .../templates/registration/password_reset_confirm.html | 17 +++++++++++++++++ yaksh/templates/registration/password_reset_done.html | 4 ++++ yaksh/templates/registration/password_reset_form.html | 12 ++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 yaksh/templates/registration/password_reset_complete.html create mode 100644 yaksh/templates/registration/password_reset_confirm.html create mode 100644 yaksh/templates/registration/password_reset_done.html create mode 100644 yaksh/templates/registration/password_reset_form.html (limited to 'yaksh/templates/registration') diff --git a/yaksh/templates/registration/password_reset_complete.html b/yaksh/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..0801d3b --- /dev/null +++ b/yaksh/templates/registration/password_reset_complete.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} +{% block title %}Password reset complete{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block content %} +

Your password has been reset.

+

Log in

+{% endblock %} diff --git a/yaksh/templates/registration/password_reset_confirm.html b/yaksh/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..5566499 --- /dev/null +++ b/yaksh/templates/registration/password_reset_confirm.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block title %}Reset Password{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Reset password {% endblock %} + +{% block content %} + {% if validlink %} +

Please enter your new password twice so we can verify you typed it in correctly

. +
+ {% csrf_token %} + {{ form.as_p }} + +
+ {% else %} +

This reset link is no longer valid!

+ {% endif %} +{% endblock %} diff --git a/yaksh/templates/registration/password_reset_done.html b/yaksh/templates/registration/password_reset_done.html new file mode 100644 index 0000000..ace3cc9 --- /dev/null +++ b/yaksh/templates/registration/password_reset_done.html @@ -0,0 +1,4 @@ +{% extends "base.html" %} +{% block title %}Password reset successful{% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Instruction for setting new password has been mailed to your registered email address {% endblock %} diff --git a/yaksh/templates/registration/password_reset_form.html b/yaksh/templates/registration/password_reset_form.html new file mode 100644 index 0000000..0dbaf09 --- /dev/null +++ b/yaksh/templates/registration/password_reset_form.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} +{% block title %} Forgot Password {% endblock %} +{% block pagetitle %} Online Test {% endblock %} +{% block formtitle %} Email will be send to the registered email address {% endblock %} +{% block content %} +
+ {% csrf_token %} + {{ form }} + + Cancel +
+{% endblock content %} -- cgit