Module: check_mk
Branch: master
Commit: 8959734e45179e4287ebd5ee442fdc82d30e437d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8959734e45179e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 9 14:10:16 2015 +0100
#1805 FIX Changing roles marks sites where users can login dirty for sync now
Previously a change to the roles did not result in a pending change for remote
sites in a distributed WATO setup. To have these changes synchronized one needed
to make another change to mark the sites dirty and make the sync possible.
This has been changed now. Each site can now be configured to make "user logins
to Web GUI possible", which is enabled by default. Those sites will be marked as
dirty now which will make the admin able to trigger a synchronisation right
after modifying a role.
---
.werks/1805 | 17 +++++++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 20 +++++++++++++++++---
3 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/.werks/1805 b/.werks/1805
new file mode 100644
index 0000000..e82d289
--- /dev/null
+++ b/.werks/1805
@@ -0,0 +1,17 @@
+Title: Changing roles marks sites where users can login dirty for sync now
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1420808847
+
+Previously a change to the roles did not result in a pending change for remote
+sites in a distributed WATO setup. To have these changes synchronized one needed
+to make another change to mark the sites dirty and make the sync possible.
+
+This has been changed now. Each site can now be configured to make "user logins
+to Web GUI possible", which is enabled by default. Those sites will be marked as
+dirty now which will make the admin able to trigger a synchronisation right
+after modifying a role.
diff --git a/ChangeLog b/ChangeLog
index e78e400..6353871 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 1789 FIX: Fix preview of passive checks in WATO list of services
* 1790 FIX: Fix WATO parameters page for passive checks...
* 1794 FIX: Fix exception in WATO service list in case of vanished checks
+ * 1805 FIX: Changing roles marks sites where users can login dirty for sync now...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 2609339..4a2163f 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10524,6 +10524,12 @@ def mode_edit_site(phase):
html.help( _('This might be needed to make the synchronization accept problems
with '
'SSL certificates when using an SSL secured connection.'))
+ forms.section(_('Direct login to Web GUI allowed'), simple=True)
+ html.checkbox('user_login', site.get('user_login', True),
+ label = _('Users are allowed to directly login into the Web GUI of
this site'))
+ html.help(_('When enabled, this site is marked for synchronisation every time a
Web GUI '
+ 'related option is changed in the master site.'))
+
forms.end()
html.button("save", _("Save"))
@@ -10886,6 +10892,11 @@ def update_replication_status(site_id, vars, times = {}):
save_replication_status(repstatus)
os.close(fd)
+def update_login_sites_replication_status():
+ for siteid, site in config.sites.items():
+ if site.get('user_login', True) and not site_is_local(siteid):
+ update_replication_status(siteid, {'need_sync': True})
+
def global_replication_state():
repstatus = load_replication_status()
some_dirty = False
@@ -12357,7 +12368,8 @@ def mode_roles(phase):
rename_user_role(delid, None) # Remove from existing users
del roles[delid]
save_roles(roles)
- log_pending(False, None, "edit-roles", _("Deleted role
'%s'" % delid))
+ update_login_sites_replication_status()
+ log_pending(AFFECTED, None, "edit-roles", _("Deleted role
'%s'" % delid))
elif c == False:
return ""
elif html.var("_clone"):
@@ -12374,7 +12386,8 @@ def mode_roles(phase):
new_role["basedon"] = cloneid
roles[newid] = new_role
save_roles(roles)
- log_pending(False, None, "edit-roles", _("Created new role
'%s'" % newid))
+ update_login_sites_replication_status()
+ log_pending(AFFECTED, None, "edit-roles", _("Created new
role '%s'" % newid))
return
table.begin("roles")
@@ -12484,7 +12497,8 @@ def mode_edit_role(phase):
rename_user_role(id, new_id)
save_roles(roles)
- log_pending(False, None, "edit-roles", _("Modified user role
'%s'" % new_id))
+ update_login_sites_replication_status()
+ log_pending(AFFECTED, None, "edit-roles", _("Modified user role
'%s'" % new_id))
return "roles"
html.begin_form("role", method="POST")