Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
66669df9
authored
Sep 20, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle "UFO" logins
parent
e26c3c37
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
cloud/urls.py
+1
-0
one/templates/registration/login.html
+11
-0
one/views.py
+6
-0
No files found.
cloud/urls.py
View file @
66669df9
...
@@ -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'
),
)
)
one/templates/registration/login.html
0 → 100644
View file @
66669df9
{% 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 %}
one/views.py
View file @
66669df9
...
@@ -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 :
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment