Module: check_mk
Branch: master
Commit: fc284da7ba8f2b6e78b6a675b84a28d2da489ca5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc284da7ba8f2b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Feb 5 13:16:05 2016 +0100
#2931 FIX Do not load bookmarks, reports, view, etc. of non-existing users anymore
---
.bugs/2180 | 6 ++++--
.bugs/2181 | 6 ++++--
.bugs/857 | 7 +++++--
.werks/2931 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/pagetypes.py | 7 +++++--
web/htdocs/visuals.py | 5 ++++-
7 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/.bugs/2180 b/.bugs/2180
index f856312..777dbd1 100644
--- a/.bugs/2180
+++ b/.bugs/2180
@@ -1,12 +1,14 @@
Title: Edit views shows elements of no longer existing users
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2016-01-20 14:05:15
Targetversion: 1.2.8
-Class: bug
1) Edit view as omdadmin
2) cd ~/var/check_mk/web ; cp -r omdadmin otheruser
3) Edit view shows view of otheruser, even if the user does not exist
+
+2016-02-05 13:15:17: changed state open -> done
diff --git a/.bugs/2181 b/.bugs/2181
index 54df119..d24818c 100644
--- a/.bugs/2181
+++ b/.bugs/2181
@@ -1,9 +1,11 @@
Title: visuals.load should only load data of existing users
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2016-01-22 12:04:33
Targetversion: 1.2.8
-Class: bug
The visual.load function also loads the directories of no longer existing users.
This does have quite a performance impact when there are thousands of users in
~/var/check_mk/web.
+
+2016-02-05 13:15:30: changed state open -> done
diff --git a/.bugs/857 b/.bugs/857
index c062bbd..5420671 100644
--- a/.bugs/857
+++ b/.bugs/857
@@ -1,9 +1,9 @@
Title: Clusterservices stay pending until cmk -R
Component: core
-State: open
+Class: bug
+State: works4me
Date: 2016-02-05 08:45:11
Targetversion: 1.2.8
-Class: bug
Hallo, nur zur INFO
@@ -14,3 +14,6 @@ bleiben immer in Pending Status,
ein cmk –R auf der Commandline behebt das Problem allerdings
Gruß H.
+
+2016-02-05 13:09:51: changed state open -> works4me
+I cannot reproduce this.
diff --git a/.werks/2931 b/.werks/2931
new file mode 100644
index 0000000..c25c8e9
--- /dev/null
+++ b/.werks/2931
@@ -0,0 +1,9 @@
+Title: Do not load bookmarks, reports, view, etc. of non-existing users anymore
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454674544
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 531ff1c..df27cda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -304,6 +304,7 @@
* 3040 FIX: Removed all summary_hosts related filters from shipped views...
* 3041 FIX: Fixed deselecting view checkbox options like "Always show
checkboxes" in dashboard embedded views
* 3046 FIX: Acknowledging all incompatible werks when creating new sites
+ * 2931 FIX: Do not load bookmarks, reports, view, etc. of non-existing users anymore
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 40278c8..eda72c7 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -24,8 +24,8 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import os
-import config, table, forms, inspect
+import os, inspect
+import config, table, forms, userdb
from lib import *
from valuespec import *
@@ -634,6 +634,9 @@ class Overridable:
# Now scan users subdirs for files "user_$type_name.mk"
subdirs = os.listdir(config.config_dir)
for user in subdirs:
+ if not userdb.user_exists(user):
+ continue
+
try:
path = "%s/%s/user_%ss.mk" % (config.config_dir, user,
self.type_name())
if not os.path.exists(path):
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index beb9b8a..9f2eade 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -33,7 +33,7 @@ except ImportError:
from lib import *
from valuespec import *
-import config, table
+import config, table, userdb
import pagetypes # That will replace visuals.py one day
# .--Plugins-------------------------------------------------------------.
@@ -127,6 +127,9 @@ def load(what, builtin_visuals, skip_func = None, lock=False):
# Now scan users subdirs for files "visuals.mk"
subdirs = os.listdir(config.config_dir)
for user in subdirs:
+ if not userdb.user_exists(user):
+ continue
+
try:
dirpath = config.config_dir + "/" + user
if not os.path.isdir(dirpath):