Module: check_mk
Branch: master
Commit: 72be0aa994ac399fae09d0176469a0b339b1ffa3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=72be0aa994ac39…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 9 10:59:01 2012 +0100
FIX: User alias and notification enabling was not saved
---
ChangeLog | 1 +
web/htdocs/wato.py | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 559ea0f..0788caf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* FIX: Fixed wrong label "Main Overview" shown for moved WATO folders
in foldertree snapin
* FIX: Fixed localization of empty host tags
+ * FIX: User alias and notification enabling was not saved
Checks & Agents:
* hpux_if: fix missing default parameter errors
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index da19c0e..23d4290 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7043,7 +7043,8 @@ def mode_edit_user(phase):
html.write("<tr><td class=legend colspan=2>")
html.write(_("Notification options<br><i>Here you specify which
types of alerts "
- "will be notified to this contact.</i>"))
+ "will be notified to this contact. Note: these settings will only be
saved "
+ "and used if the user is member of a contact
group.</i>"))
html.write("</td><td class=content>")
for title, what, opts in [ ( _("Host events"), "host",
"durfs"),
(_("Service events"), "service",
"wucrfs") ]:
@@ -7175,8 +7176,12 @@ def split_dict(d, keylist, positive):
def save_users(profiles):
# TODO: delete var/check_mk/web/$USER of non-existing users. Do we
# need to remove other references as well?
- non_contact_keys = [ "roles", "password", "locked",
"automation_secret", "language" ]
- multisite_keys = [ "roles", "language" ]
+
+ # Keys not to put into contact definitions for Check_MK
+ non_contact_keys = [ "roles", "notifications_enabled",
"password", "locked", "automation_secret",
"language" ]
+
+ # Keys to put into multisite configuration
+ multisite_keys = [ "roles", "notifications_enabled",
"locked", "automation_secret", "alias",
"language", ]
# Remove multisite keys in contacts. And use only such entries
# that have any contact groups assigned to.
@@ -7187,7 +7192,7 @@ def save_users(profiles):
in profiles.items() ]
if e[1].get("contactgroups"))
- # Only allow explicit defined attributes to be written to multisite config
+ # Only allow explicitely defined attributes to be written to multisite config
users = {}
for uid, profile in profiles.items():
users[uid] = dict([ (p, val) for p, val in profile.items() if p in multisite_keys
])