From 4ea9df753e6f3a62ca9d27bd78208d82bacc9306 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Wed, 7 Jun 2017 18:08:15 +0200 Subject: [PATCH] For failed logins the source ip-adress is logged now ( #201) --- cps/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/web.py b/cps/web.py index 7273e1aa..c810ee7f 100755 --- a/cps/web.py +++ b/cps/web.py @@ -1806,10 +1806,10 @@ def login(): if user and check_password_hash(user.password, form['password']): login_user(user, remember=True) flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success") - # test= return redirect(url_for("index")) 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") return render_title_template('login.html', title=_(u"login"))