Module: check_mk
Branch: master
Commit: e6ae3df527c2a27a9774cc6e7be9a2a10f9ce73e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e6ae3df527c2a2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 16 09:16:02 2018 +0100
5733 FIX Fixed bulk deletion of users with special characters in their ID
Change-Id: I948f763495d7efd8de223a006d5bb98945eadb85
---
.werks/5733 | 10 ++++++++++
web/htdocs/wato.py | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/5733 b/.werks/5733
new file mode 100644
index 0000000..102150e
--- /dev/null
+++ b/.werks/5733
@@ -0,0 +1,10 @@
+Title: Fixed bulk deletion of users with special characters in their ID
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1518768939
+Class: fix
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index b20622b..433ff5d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10617,7 +10617,7 @@ class ModeUsers(WatoMode):
users = userdb.load_users()
for varname in html.all_varnames_with_prefix("_c_user_"):
if html.get_checkbox(varname):
- user = varname.split("_c_user_")[-1]
+ user =
base64.b64decode(varname.split("_c_user_")[-1]).decode("utf-8")
if user in users:
selected_users.append(user)
@@ -10660,7 +10660,7 @@ class ModeUsers(WatoMode):
value='X'), sortable=False, css="checkbox")
if id != config.user.id:
- html.checkbox("_c_user_%s" % id)
+ html.checkbox("_c_user_%s" %
base64.b64encode(id.encode("utf-8")))
user_connection_id =
userdb.cleanup_connection_id(user.get('connector'))
connection = userdb.get_connection(user_connection_id)