Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
c0340cc2
Commit
c0340cc2
authored
Aug 30, 2016
by
Julian Rother
Browse files
Cleanup login code
parent
8fd47ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
c0340cc2
...
...
@@ -15,11 +15,9 @@ config['SQLITE_INIT_SCHEMA'] = True
config
[
'SQLITE_INIT_DATA'
]
=
False
config
[
'DEBUG'
]
=
False
config
[
'VIDEOPREFIX'
]
=
'https://videoag.fsmpi.rwth-aachen.de'
if
__name__
==
'__main__'
:
config
[
'SQLITE_INIT_DATA'
]
=
True
config
[
'DEBUG'
]
=
True
config
.
from_pyfile
(
'config.py'
,
silent
=
True
)
from
db
import
query
,
searchquery
,
ldapauth
,
ldapget
...
...
@@ -144,18 +142,12 @@ def login():
session
[
'user'
]
=
ldapget
(
user
)
else
:
flash
(
'Login fehlgeschlagen!'
)
if
'ref'
in
request
.
values
:
return
redirect
(
request
.
values
[
'ref'
])
else
:
return
redirect
(
url_for
(
'index'
))
return
redirect
(
request
.
values
.
get
(
'ref'
,
url_for
(
'index'
)))
@
app
.
route
(
'/logout'
)
@
app
.
route
(
'/logout'
,
methods
=
[
'GET'
,
'POST'
]
)
def
logout
():
session
.
pop
(
'user'
)
if
'ref'
in
request
.
values
:
return
redirect
(
request
.
values
[
'ref'
])
else
:
return
redirect
(
url_for
(
'index'
))
return
redirect
(
request
.
values
.
get
(
'ref'
,
url_for
(
'index'
)))
@
app
.
route
(
'/edit'
,
methods
=
[
'GET'
,
'POST'
])
@
mod_required
...
...
Write
Preview
Supports
Markdown
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