Commit 5e44a3f4 authored by David Seaward's avatar David Seaward

additional registration templates

parent 7dc10b21
Roadmap
=======
## Basic tests
* ~~Login: user exists (logged in)~~
* ~~Login: user does not exist (should fail)~~
* ~~Register: user exists (should fail)~~
* ~~Register: user does not exist (logged in)~~
* ~~Logout: (logged out)~~
## Login
* Django + LDAP users exist
* LDAP user exists
* Django user exists (should fail)
* Neither user exists (should fail)
## Registration
* Django + LDAP users exist (should skip)
* LDAP user exists
* Django user exists
* Neither user exists
## Change password
* Django + LDAP users exist
* LDAP user exists
* Django user exists (should fail)
* Neither user exists (should fail)
## Future
* Disable registration actions we don't require
* Rate-limit registrations (+ other abusive behaviour?)
* Enabling/disabling services (implement as pre-existing LDAP groups?)
......@@ -10,15 +10,21 @@
<h1>Puri.st services</h1>
{% if username %}
<p>
You are logged in as $name.<br />
You are logged in as {{username}}.<br />
<a href="/accounts/logout/">Log out</a>
</p>
{% else %}
<p>
You are not logged in.<br />
<a href="/accounts/login/">Log in</a> or <a href="/accounts/register/">register</a>.
</p>
{% endif %}
<p>
<a href="/admin/">Admin</a>
</p>
</body>
</html>
{# The following code adapted from https://github.com/yourcelf/django-registration-defaults Copyright 2010 Charlie DeTar SPDX-License-Identifier: MIT (aka Expat) #}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %}
{% url 'auth_password_reset' as auth_pwd_reset_url %}
{% url 'registration_register' as register_url%}
{% if form.errors %}
<p>{% blocktrans %}Your username and password didn't match. Please try again.{% endblocktrans %}</p>
{% endif %}
<form method="post" action="{% url 'auth_login' %}">{% csrf_token %}
<table>
<tr>
<td>{% trans form.username.label_tag %}</td>
<td>{{ form.username }}</td>
</tr>
<tr>
<td>{% trans form.password.label_tag %}</td>
<td>{{ form.password }}</td>
</tr>
</table>
<p>{% blocktrans %}<a href="{{ register_url }}">Need an account</a>?{% endblocktrans %}</p>
<input type="submit" value="{% trans 'login' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{% endblock %}
{# The following code adapted from https://github.com/yourcelf/django-registration-defaults Copyright 2010 Charlie DeTar SPDX-License-Identifier: MIT (aka Expat) #}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Logged out" %}{% endblock %}
{% block content %}
{% trans "Successfully logged out!" %}<br />
<a href="/">Home</a>
{% endblock %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment