Module: check_mk
Branch: master
Commit: eb27eac871bcccc35ba6a81c6ec1f55e605b37cd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb27eac871bccc…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jun 9 17:02:50 2017 +0200
4713 FIX logwatch: fixed missing "Clear log" button for normal user in
distributed setup
Change-Id: I360305e5dc70408602494a9e72de52cb83b8ad3c
---
.werks/4713 | 11 +++++++++++
web/htdocs/logwatch.py | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/.werks/4713 b/.werks/4713
new file mode 100644
index 0000000..bb08a09
--- /dev/null
+++ b/.werks/4713
@@ -0,0 +1,11 @@
+Title: logwatch: fixed missing "Clear log" button for normal user in
distributed setup
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1497020543
+
+
diff --git a/web/htdocs/logwatch.py b/web/htdocs/logwatch.py
index f6bf93b..3b301d3 100644
--- a/web/htdocs/logwatch.py
+++ b/web/htdocs/logwatch.py
@@ -566,6 +566,10 @@ def may_see(site, host_name):
if config.user.may("general.see_all"):
return True
+ if site:
+ sites.live().set_only_sites([site])
+
+ # Note: This query won't work in a distributed setup and no site given as
argument
# livestatus connection is setup with AuthUser
return sites.live().query_value("GET hosts\nStats: state >= 0\nFilter: name =
%s\n" % lqencode(host_name)) > 0