Module: check_mk
Branch: master
Commit: 74afccbe5ecad9c20d26cf69bb92ccf81298a0a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=74afccbe5ecad9…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Oct 9 16:52:32 2013 +0200
fixed problem with ldap userid encoding
---
ChangeLog | 1 +
web/htdocs/userdb.py | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 1367601..2d238bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* FIX: add missing service icons to view "All Services with this descr..."
* FIX: ldap attribute plugins: fixed crash when parameters are None
* FIX: avoid duplicate output of log message in log tables
+ * FIX: fixed problem with ldap userid encoding
WATO:
* Rule "State and count of processes": New configuration options:
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 13281b9..51814ee 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -399,8 +399,13 @@ def save_users(profiles):
# Write out the users serials
serials_file = '%s/auth.serials' % os.path.dirname(defaults.htpasswd_file)
out = create_user_file(serials_file, "w")
+ def encode_utf8(value):
+ if type(value) == unicode:
+ value = value.encode("utf-8")
+ return value
+
for user_id, user in profiles.items():
- out.write('%s:%d\n' % (user_id, user.get('serial', 0)))
+ out.write('%s:%d\n' % (encode_utf8(user_id), user.get('serial',
0)))
out.close()
# Write user specific files