Module: check_mk
Branch: master
Commit: 2ed0a3438324e89bce210ea128db853eed198805
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ed0a3438324e8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 28 10:01:06 2014 +0100
#1538 FIX Only allow switching sites on/off when permitted to
The permission check was missing in the action processing server component.
---
.werks/1538 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/html_mod_python.py | 23 ++++++++++++-----------
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/.werks/1538 b/.werks/1538
new file mode 100644
index 0000000..594fcd2
--- /dev/null
+++ b/.werks/1538
@@ -0,0 +1,9 @@
+Title: Only allow switching sites on/off when permitted to
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417165211
+Class: fix
+
+The permission check was missing in the action processing server component.
diff --git a/ChangeLog b/ChangeLog
index d1fd67a..7a864d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,7 @@
* 1534 FIX: Fixed filtering views in distributed setup lead to empty views...
* 1553 FIX: Fix deleting (acknowleding) of logfiles in logwatch...
* 1537 FIX: Added transformation code for user dashboards created between 2014-08 and
2014-10...
+ * 1538 FIX: Only allow switching sites on/off when permitted to...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 94f594f..1d9dc24 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -233,17 +233,18 @@ def connect_to_livestatus():
# Also honor HTML-variables for switching off sites
# right now. This is generally done by the variable
# _site_switch=sitename1:on,sitename2:off,...
- switch_var = html.var("_site_switch")
- if switch_var:
- for info in switch_var.split(","):
- sitename, onoff = info.split(":")
- d = config.user_siteconf.get(sitename, {})
- if onoff == "on":
- d["disabled"] = False
- else:
- d["disabled"] = True
- config.user_siteconf[sitename] = d
- config.save_site_config()
+ if config.may("sidesnap.sitestatus"):
+ switch_var = html.var("_site_switch")
+ if switch_var:
+ for info in switch_var.split(","):
+ sitename, onoff = info.split(":")
+ d = config.user_siteconf.get(sitename, {})
+ if onoff == "on":
+ d["disabled"] = False
+ else:
+ d["disabled"] = True
+ config.user_siteconf[sitename] = d
+ config.save_site_config()
# Make lists of enabled and disabled sites
enabled_sites = {}