Module: check_mk
Branch: master
Commit: ea2b642a3f323b6a3c5541617e4180c5065660bf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ea2b642a3f323b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 22 15:44:44 2012 +0200
FIX: fix sorting of users, fix lost user alias in some situations
---
ChangeLog | 1 +
web/htdocs/wato.py | 4 +---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 37cf8e7..8dd3986 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
* FIX: fix layout bug in ValueSpec ListOfStrings (e.g. used in
list of explicit host/services in rules)
* FIX: fix inheritation of contactgroups from folder to hosts
+ * FIX: fix sorting of users, fix lost user alias in some situations
BI:
* FIX: Correct representation of (!), (!!) and (?) markers in check output
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5e079ae..ee4f436 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7625,7 +7625,7 @@ def mode_users(phase):
odd = "even"
entries = users.items()
- entries.sort(cmp = lambda a, b: cmp(a[1].get("alias").lower(),
b[1].get("alias").lower()))
+ entries.sort(cmp = lambda a, b: cmp(a[1].get("alias", a[0]).lower(),
b[1].get("alias", b[0]).lower()))
for id, user in entries:
odd = odd == "odd" and "even" or "odd"
html.write('<tr class="data %s0">' % odd)
@@ -8135,14 +8135,12 @@ def load_users():
if id in result:
result[id]["password"] = password
result[id]["locked"] = locked
- result[id]["alias"] = ""
else:
# Create entry if this is an admin user
new_user = {
"roles" : config.roles_of_user(id),
"password" : password,
"locked" : False,
- "alias" : ""
}
result[id] = new_user
# Other unknown entries will silently be dropped. Sorry...