Module: check_mk
Branch: master
Commit: 168cbcc2dc0ac4df8e71cf15dc133a493c5792d2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=168cbcc2dc0ac4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 16 13:42:04 2018 +0200
5978 FIX Fixed possible exception when user has invalid idle timeout value configured
The login session idle timeout can be configured individually per user. This setting
is stored in the file <tt>var/check_mk/web/[user]/idle_timeout.mk</tt>. When
this
file contains an invalid value, the global default value is used instead of raising
an error message.
Change-Id: I7bbec234d0dcd8acb467b1422fbc2e458ec60116
---
.werks/5978 | 14 ++++++++++++++
web/htdocs/userdb.py | 8 +++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/5978 b/.werks/5978
new file mode 100644
index 0000000..3018567
--- /dev/null
+++ b/.werks/5978
@@ -0,0 +1,14 @@
+Title: Fixed possible exception when user has invalid idle timeout value configured
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1523878776
+
+The login session idle timeout can be configured individually per user. This setting
+is stored in the file <tt>var/check_mk/web/[user]/idle_timeout.mk</tt>. When
this
+file contains an invalid value, the global default value is used instead of raising
+an error message.
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index be52ffa..b8139a5 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -912,7 +912,13 @@ def contactgroups_of_user(user_id):
def convert_idle_timeout(value):
- return value != "False" and int(value) or False
+ if value == "False":
+ return False # Idle timeout disabled
+
+ try:
+ return int(value)
+ except ValueError:
+ return None # Invalid value -> use global setting
#.