Module: check_mk
Branch: master
Commit: 83d5acb70d8316364efaac58116661954c85e4a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83d5acb70d8316…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 1 11:39:42 2016 +0200
3659 FIX Fixed GUI exceptions for users having special characters in ther user names
---
.werks/3659 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/config.py | 2 +-
web/htdocs/userdb.py | 2 +-
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/3659 b/.werks/3659
new file mode 100644
index 0000000..8308fb6
--- /dev/null
+++ b/.werks/3659
@@ -0,0 +1,10 @@
+Title: Fixed GUI exceptions for users having special characters in ther user names
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1467365886
+
+
diff --git a/ChangeLog b/ChangeLog
index ea0a384..b012bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -375,6 +375,7 @@
* 3586 FIX: Fixed file locking issues (rare and random errors that settings file
could not be loaded)
* 2239 FIX: Fixed exception in WATO snapins Folders, Tree of folders and Virtual Host
Tree...
* 3148 FIX: fixed Edit View/Dashlet Dialogs offering non-sensical filter choices...
+ * 3659 FIX: Fixed GUI exceptions for users having special characters in ther user
names
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index a3dda3e..0335e2c 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -466,7 +466,7 @@ def load_user_file(name, deflt, lock = False):
def save_user_file(name, content, unlock=False, user=None):
if user == None:
user = user_id
- dirname = config_dir + "/" + user
+ dirname = config_dir + "/" + user.encode("utf-8")
make_nagios_directory(dirname)
path = dirname + "/" + name + ".mk"
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index af7d8f8..5ae219f 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -191,7 +191,7 @@ def user_exists(username):
def _user_exists_according_to_profile(username):
- base_path = config.config_dir + "/" + username + "/"
+ base_path = config.config_dir + "/" + username.encode("utf-8") +
"/"
return os.path.exists(base_path + "transids.mk") \
or os.path.exists(base_path + "serial.mk")