diff --git a/main/forms.py b/main/forms.py index bbb713c..f04a697 100644 --- a/main/forms.py +++ b/main/forms.py @@ -1,3 +1,8 @@ -from django.contrib.auth.forms import PasswordChangeForm +from django.contrib.auth.forms import PasswordChangeForm, SetPasswordForm class LDAPPasswordChangeForm(PasswordChangeForm): + # TODO: Change password here + pass + +class LDAPSetPasswordForm(SetPasswordForm): + # TODO: Set password here pass diff --git a/templates/public/index.html b/templates/public/index.html index ab5f8f9..66438b1 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -1 +1,5 @@ +{% extends "base.html" %} +{% block content %} {{request.user}}s profile +Forgot password? +{% endblock %} diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html new file mode 100644 index 0000000..51add04 --- /dev/null +++ b/templates/registration/password_change_done.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} +{% block title %}Change password done{% endblock %} +{% block content %} +
+The page shown after a user has changed their password. +
+{% endblock %} diff --git a/templates/registration/password_change_form.html b/templates/registration/password_change_form.html index e69de29..efe1bee 100644 --- a/templates/registration/password_change_form.html +++ b/templates/registration/password_change_form.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} +{% block title %}Change password{% endblock %} +{% block content %} ++Allows a user to change their password. +
+ +{% endblock %} + diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html new file mode 100644 index 0000000..3c67b27 --- /dev/null +++ b/templates/registration/password_reset_complete.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block title %}Password reset complete{% endblock %} +{% block content %} +The page shown after a user has been emailed a link to reset their password. +{% endblock %} diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html new file mode 100644 index 0000000..7b15828 --- /dev/null +++ b/templates/registration/password_reset_confirm.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}Password reset confirmation{% endblock %} +{% block content %} ++Presents a form for entering a new password. +
+{% if validlink %} + + +{% endblock %} + diff --git a/templates/registration/password_reset_subject.txt b/templates/registration/password_reset_subject.txt new file mode 100644 index 0000000..5e162fb --- /dev/null +++ b/templates/registration/password_reset_subject.txt @@ -0,0 +1 @@ +[neuf-userinfo] Reset password diff --git a/urls.py b/urls.py index d6f65eb..5af0857 100644 --- a/urls.py +++ b/urls.py @@ -1,17 +1,22 @@ from django.conf.urls.defaults import * from django.contrib import admin -from main.forms import LDAPPasswordChangeForm +from main.forms import LDAPPasswordChangeForm, LDAPSetPasswordForm admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^accounts/$', 'main.views.profile'), - (r'^accounts/logout/$', 'django.contrib.auth.views.logout'), (r'^accounts/password/change$', 'django.contrib.auth.views.password_change', {'password_change_form': LDAPPasswordChangeForm}), (r'^accounts/password/change/done$', 'django.contrib.auth.views.password_change_done'), + (r'^accounts/password/reset$', 'django.contrib.auth.views.password_reset'), + (r'^accounts/password/reset/done$', 'django.contrib.auth.views.password_reset_done'), + (r'^accounts/password/reset/confirm$', 'django.contrib.auth.views.password_reset_confirm', + {'set_password_form': LDAPSetPasswordForm}), + (r'^accounts/password/reset/complete$', 'django.contrib.auth.views.password_reset_complete'), (r'^accounts/login/$', 'django.contrib.auth.views.login'), + (r'^accounts/logout/$', 'django.contrib.auth.views.logout'), (r'^accounts/(?P