Module: check_mk
Branch: master
Commit: f8e3112a90cd31f06ac17a30290915f72e2f5abb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f8e3112a90cd31…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Sep 13 11:15:27 2017 +0200
5228 FIX WATO Web-API: now able to edit users which were created through the GUI
Users created through the WATO users page lacked the attribute
<tt>"connector":"htpasswd"</tt>.
The edit_users Web API call can now handle this scenario.
---
.werks/5228 | 12 ++++++++++++
web/plugins/webapi/webapi.py | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/5228 b/.werks/5228
new file mode 100644
index 0000000..fda376a
--- /dev/null
+++ b/.werks/5228
@@ -0,0 +1,12 @@
+Title: WATO Web-API: now able to edit users which were created through the GUI
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1505293943
+Class: fix
+
+Users created through the WATO users page lacked the attribute
<tt>"connector":"htpasswd"</tt>.
+The edit_users Web API call can now handle this issue.
+
diff --git a/web/plugins/webapi/webapi.py b/web/plugins/webapi/webapi.py
index 06c65a8..6df4f93 100644
--- a/web/plugins/webapi/webapi.py
+++ b/web/plugins/webapi/webapi.py
@@ -605,7 +605,7 @@ def action_edit_users(request):
if user_id not in all_users:
raise MKUserError(None, _("Unknown user: %s") % user_id)
- if all_users[user_id].get("connector") != "htpasswd":
+ if all_users[user_id].get("connector", "htpasswd") !=
"htpasswd":
raise MKUserError(None, _("This user is not a htpasswd user: %s") %
user_id)
user_attrs = copy.deepcopy(all_users[user_id])