Set up authentication system

This commit is contained in:
tjp03u
2014-10-23 22:13:03 +01:00
parent e10021d47b
commit 4540be7ecf
41 changed files with 705 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
{% load url from future %}
Welcome {{ profile.first_name }},
You request to become a user on {{ site }} has been approved by an administrator.
To continue the registration process please visit http://{{ site.domain }}{% url 'registration_activate' activation_key=activation_key %}.
This link will be active for the next {{ expiration_days }} days.
{% if message %}
Message from administrator:
{{ message }}
{% endif %}

View File

@@ -0,0 +1 @@
{{ site }} user {{ user }} activation {{ activation_key }}

View File

@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% block title %}Activation Complete{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Activation Complete</h2>
<p>You user account is now fully registered. Enjoy RIGS</p>
</div>
{% endblock %}

View File

@@ -0,0 +1,5 @@
Congratulations {{ user.first_name }}. You are now fully registered on {{ site }}.
{% if is_generated %}
You password for this site has been automatically set to {{ password }}. It is recommend you change this as soon as possible.
{% endif %}

View File

@@ -0,0 +1 @@
{{ user }} activation successful

View File

@@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% load widget_tweaks %}
{% block title %}Activation{% endblock %}
{% block content %}
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-2">{{ field.label }}</label>
<div class="controls col-sm-10">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
<p><input type="submit" value="Activate Account" class="btn btn-primary pull-right"></p>
</form>
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% block title %}Logout Successful{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Logout Successful</h2>
<p>You have successfully been logged out of RIGS</p>
</div>
{% endblock %}

View File

@@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block title %}Login{% endblock %}
{% block content %}
{% include 'registration/loginform.html' %}
{% endblock %}

View File

@@ -0,0 +1,22 @@
{% load url from future %}
{% load widget_tweaks %}
{% if form.errors %}
<div class="error">Your username or password was incorrect</div>
{% endif %}
<div class="col-md-4 col-md-offset-4">
<form action="{% url 'login' %}" method="post" role="form">{% csrf_token %}
<div class="form-group">
<label for="id_username">{{ form.username.label }}</label>
{% render_field form.username class+="form-control" placeholder=form.username.label %}
</div>
<div class="form-group">
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}</label>
{% render_field form.password class+="form-control" placeholder=form.password.label %}
</div>
<a href="{% url 'registration_register' %}" class="btn">Register</a>
<a href="{% url 'password_reset' %}" class="btn">Forgotten Password</a>
<input type="submit" value="Login" class="btn btn-primary" />
<input type="hidden" name="next" value="{{next}}" />
</form>
</div>

View File

@@ -0,0 +1,3 @@
A new user has just registered on {{ site }} with username {{ user.username }} and email {{ user.email }}.
Please visit {{ site.domain }}{% url admin:registration_registrationprofile_change user.registration_profile.id %} to moderate this activation.

View File

@@ -0,0 +1 @@
{{ site }} New User Approval Require

View File

@@ -0,0 +1,56 @@
{% extends "admin/base_site.html" %}
{% load i18n static %}
{% load url from future %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password change' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password change' %}{% endblock %}
{% block content %}<div id="content-main">
<form action="" method="post">{% csrf_token %}
<div>
{% if form.errors %}
<p class="errornote">
{% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
</p>
{% endif %}
<h1>{% trans 'Password change' %}</h1>
<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
<fieldset class="module aligned wide">
<div class="form-row">
{{ form.old_password.errors }}
<label for="id_old_password" class="required">{% trans 'Old password' %}:</label>{{ form.old_password }}
</div>
<div class="form-row">
{{ form.new_password1.errors }}
<label for="id_new_password1" class="required">{% trans 'New password' %}:</label>{{ form.new_password1 }}
</div>
<div class="form-row">
{{ form.new_password2.errors }}
<label for="id_new_password2" class="required">{% trans 'Password (again)' %}:</label>{{ form.new_password2 }}
</div>
</fieldset>
<div class="submit-row">
<input type="submit" value="{% trans 'Change my password' %}" class="default" />
</div>
<script type="text/javascript">document.getElementById("id_old_password").focus();</script>
</div>
</form></div>
{% endblock %}

View File

@@ -0,0 +1,23 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset complete' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password reset complete' %}</h1>
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
</div>
{% endblock %}

View File

@@ -0,0 +1,61 @@
{% extends "base.html" %}
{% load i18n %}
{% load widget_tweaks %}
{% load url from future %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset confirmation' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset' %}{% endblock %}
{% block content %}
{% if validlink %}
<div class="col-sm-12">
<h1>{% trans 'Enter new password' %}</h1>
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="post" role="form" class="form-horizontal">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.new_password1.id_for_label}}" class="col-sm-4 control-label">{{form.new_password1.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password1 class+="form-control" %}
</div>
</div>
<div class="form-group">
<label for="{{form.new_password2.id_for_label}}" class="col-sm-4 control-label">{{form.new_password2.label}}</label>
<div class="col-sm-8">
{% render_field form.new_password2 class+="form-control" %}
</div>
</div>
<div class="col-sm-12">
<div class="pull-right">
<div class="form-group">
<input type="submit" value="{% trans 'Change my password' %}" class="btn btn-primary" />
</div>
</div>
</div>
</form>
</div>
{% else %}
<h1>{% trans 'Password reset unsuccessful' %}</h1>
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}</p>
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; {% trans 'Password reset' %}
</div>
{% endblock %}
{% block title %}{% trans 'Password reset successful' %}{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>{% trans 'Password reset successful' %}</h1>
<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
</div>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% load i18n %}{% load url from future %}{% autoescape off %}
{% blocktrans %}You're receiving this e-mail because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'auth_password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@@ -0,0 +1,34 @@
{% extends 'base.html' %}
{% load i18n %}
{% load widget_tweaks %}
{% block title %}Password reset{% endblock %}
{% block content %}
<div class="col-sm-12">
<h1>Password Reset</h1>
<p>{% trans "Forgotten your password? Enter your e-mail address below, and we'll e-mail instructions for setting a new one." %}</p>
<div class="col-sm-8 col-sm-offset-2 well">
<form action="" method="POST" role="form" class="form-horizontal">{% csrf_token %}
{% if form.errors %}
{% include 'form_errors.html' %}
{% endif %}
<div class="form-group">
<label for="{{form.email.id_for_label}}" class="col-sm-2 control-label">{{form.email.label}}</label>
<div class="col-sm-10">
{% render_field form.email type="email" class+="form-control" %}
</div>
</div>
<div class="col-sm-12">
<div class="pull-right">
<div class="form-group">
<input type="submit" value="Submit" class="btn btn-primary" />
</div>
</div>
</div>
</form>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% block title %}Registration complete{% endblock %}
{% block content %}
<div class="alert alert-success">
<h2>Thanks for registering</h2>
<p>Thanks for registering with RIGS, you application will now be moderated by an administrator and further instructions will be emailed to you</p>
</div>
{% endblock %}

View File

@@ -0,0 +1,3 @@
You account has been created but now requires approval by one of our moderation team.
Please wait while this is done.

View File

@@ -0,0 +1 @@
{{ site }} User Awaiting Approval

View File

@@ -0,0 +1,32 @@
{% extends 'base.html' %}
{% load widget_tweaks %}
{% block title %}Registration{% endblock %}
{% block content %}
{% if form.errors or supplement_form.errors %}
<div class="alert alert-danger">
{{form.errors}}
{{supplement_form.errors}}
</div>
{% endif %}
<form action="" method="post" class="form-horizontal" role="form">{% csrf_token %}
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-2">{{ field.label }}</label>
<div class="controls col-sm-10">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
{% for field in supplement_form %}
<div class="form-group">
<label for="{{ field.id_for_label }}" class="control-label col-sm-2">{{ field.label }}</label>
<div class="controls col-sm-10">
{% render_field field class+="form-control" placeholder=field.label %}
</div>
</div>
{% endfor %}
<p><input type="submit" value="Register" class="btn btn-primary pull-right"></p>
</form>
{% endblock %}