Commit 66669df9 by Őry Máté

handle "UFO" logins

parent e26c3c37
...@@ -92,4 +92,5 @@ urlpatterns = patterns('', ...@@ -92,4 +92,5 @@ urlpatterns = patterns('',
url(r'^stat/$', 'one.views.stat'), url(r'^stat/$', 'one.views.stat'),
url(r'^sites/(?P<site>[a-zA-Z0-9]+)/$', 'one.views.sites'), url(r'^sites/(?P<site>[a-zA-Z0-9]+)/$', 'one.views.sites'),
url(r'^accounts/(?P<site>profile)/$', 'one.views.sites'), url(r'^accounts/(?P<site>profile)/$', 'one.views.sites'),
url(r'^ufo/$', 'one.views.login'),
) )
{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}
{% get_current_language as LANGUAGE_CODE %}
{% block content %}
<form action="/ufo/" method="POST">
{% csrf_token %}
{{ form }}
<input type="submit" value="LOGIN" />
</form>
{% endblock %}
...@@ -4,6 +4,7 @@ from django.conf import settings ...@@ -4,6 +4,7 @@ from django.conf import settings
from datetime import timedelta as td from datetime import timedelta as td
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.views import login as auth_login
from django.contrib import messages from django.contrib import messages
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.core import signing, urlresolvers from django.core import signing, urlresolvers
...@@ -641,4 +642,9 @@ def sites(request, site): ...@@ -641,4 +642,9 @@ def sites(request, site):
else: else:
return redirect(home) return redirect(home)
def login(request, *args, **kwargs):
request.session.set_expiry(0)
return auth_login(request, *args, **kwargs)
# vim: et sw=4 ai fenc=utf8 smarttab : # vim: et sw=4 ai fenc=utf8 smarttab :
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 sign in to comment