Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
4ea9df75
Commit
4ea9df75
authored
Jun 07, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For failed logins the source ip-adress is logged now ( #201)
parent
e6c6c26f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
web.py
cps/web.py
+2
-2
No files found.
cps/web.py
View file @
4ea9df75
...
@@ -1806,10 +1806,10 @@ def login():
...
@@ -1806,10 +1806,10 @@ def login():
if
user
and
check_password_hash
(
user
.
password
,
form
[
'password'
]):
if
user
and
check_password_hash
(
user
.
password
,
form
[
'password'
]):
login_user
(
user
,
remember
=
True
)
login_user
(
user
,
remember
=
True
)
flash
(
_
(
u"you are now logged in as: '
%(nickname)
s'"
,
nickname
=
user
.
nickname
),
category
=
"success"
)
flash
(
_
(
u"you are now logged in as: '
%(nickname)
s'"
,
nickname
=
user
.
nickname
),
category
=
"success"
)
# test=
return
redirect
(
url_for
(
"index"
))
return
redirect
(
url_for
(
"index"
))
else
:
else
:
app
.
logger
.
info
(
'Login failed for user "'
+
form
[
'username'
]
+
'"'
)
ipAdress
=
request
.
headers
.
get
(
'X-Forwarded-For'
,
request
.
remote_addr
)
app
.
logger
.
info
(
'Login failed for user "'
+
form
[
'username'
]
+
'" IP-adress: '
+
ipAdress
)
flash
(
_
(
u"Wrong Username or Password"
),
category
=
"error"
)
flash
(
_
(
u"Wrong Username or Password"
),
category
=
"error"
)
return
render_title_template
(
'login.html'
,
title
=
_
(
u"login"
))
return
render_title_template
(
'login.html'
,
title
=
_
(
u"login"
))
...
...
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