mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 16:56:32 +01:00
We now have user authentication via the web interface. @whee.
This commit is contained in:
parent
be4e0069a6
commit
2e397df4d5
4 changed files with 56 additions and 5 deletions
6
urls.py
6
urls.py
|
|
@ -10,12 +10,16 @@ from django.conf.urls.defaults import *
|
|||
import settings
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# User Authentication
|
||||
(r'^accounts/login', 'django.contrib.auth.views.login'),
|
||||
(r'^accounts/logout', 'django.contrib.auth.views.logout'),
|
||||
|
||||
# Admin interface
|
||||
(r'^admin/', include('django.contrib.admin.urls')),
|
||||
|
||||
# Front page
|
||||
(r'^', include('apps.website.urls')),
|
||||
|
||||
|
||||
# News stuff
|
||||
(r'^news/', include('apps.news.urls')),
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
{% block header_ext %}
|
||||
{% endblock %}
|
||||
|
||||
<title>{{game_name}} - {% if flatpage %}{{flatpage.title}}{% else %}{{page_title}}{% endif %}</title>
|
||||
<title>{{game_name}} - {% if flatpage %}{{flatpage.title}}{% else %}{% block titleblock %}{{page_title}}{% endblock %}{% endif %}</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
@ -45,9 +45,15 @@
|
|||
|
||||
<div class="headerLinks">
|
||||
<span class="doNotDisplay">Tools:</span>
|
||||
<a href="/tbi">Log In «</a>
|
||||
<span class="doNotDisplay">|</span>
|
||||
<a href="/tbi">Register «</a>
|
||||
{% if user.is_authenticated %}
|
||||
<a href="/accounts/logout/">Log Out «</a>
|
||||
<span class="doNotDisplay">|</span>
|
||||
Logged in as {{user.username}} «
|
||||
{% else %}
|
||||
<a href="/accounts/login/">Log In «</a>
|
||||
<span class="doNotDisplay">|</span>
|
||||
<a href="/tbi">Register «</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
10
webtemplates/prosimii/registration/logged_out.html
Normal file
10
webtemplates/prosimii/registration/logged_out.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block titleblock %}
|
||||
Logged Out
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 id="alt-layout">Logged Out</h1>
|
||||
<p>You have been logged out.</p>
|
||||
{% endblock %}
|
||||
31
webtemplates/prosimii/registration/login.html
Normal file
31
webtemplates/prosimii/registration/login.html
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block titleblock %}
|
||||
Login
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 id="alt-layout">Login</h1>
|
||||
{% if user.is_authenticated %}
|
||||
<p>You are already logged in!</p>
|
||||
{% else %}
|
||||
{% if form.has_errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action=".">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="id_username">Username:</label></td>
|
||||
<td>{{ form.username }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="id_password">Password:</label></td>
|
||||
<td>{{ form.password }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" value="Login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue