From 59b78f99848bb7689e537c45be04cbaf9fa91b19 Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sat, 20 Jun 2020 15:41:26 +0200 Subject: [PATCH] enable disabling of remember_me function --- cps/web.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cps/web.py b/cps/web.py index 8d48bee7..0e0578ea 100644 --- a/cps/web.py +++ b/cps/web.py @@ -1437,14 +1437,14 @@ def login(): if config.config_login_type == constants.LOGIN_LDAP and services.ldap and user and form['password'] != "": login_result, error = services.ldap.bind_user(form['username'], form['password']) if login_result: - login_user(user, remember=True) + login_user(user, remember=bool(form.get('remember_me'))) log.debug(u"You are now logged in as: '%s'", user.nickname) flash(_(u"you are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success") return redirect_back(url_for("web.index")) elif login_result is None and user and check_password_hash(str(user.password), form['password']) \ and user.nickname != "Guest": - login_user(user, remember=True) + login_user(user, remember=bool(form.get('remember_me'))) log.info("Local Fallback Login as: '%s'", user.nickname) flash(_(u"Fallback Login as: '%(nickname)s', LDAP Server not reachable, or user not known", nickname=user.nickname), @@ -1473,7 +1473,7 @@ def login(): log.info('Username missing for password reset IP-adress: %s', ipAdress) else: if user and check_password_hash(str(user.password), form['password']) and user.nickname != "Guest": - login_user(user, remember=True) + login_user(user, remember=bool(form.get('remember_me'))) log.debug(u"You are now logged in as: '%s'", user.nickname) flash(_(u"You are now logged in as: '%(nickname)s'", nickname=user.nickname), category="success") config.config_is_initial = False