Module: check_mk
Branch: master
Commit: a706dadaf54b575b816665998c11c73fa69ebc92
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a706dadaf54b57…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 16 13:51:54 2012 +0100
WATO: preserve/honors users only in htpasswd
---
ChangeLog | 2 ++
web/htdocs/wato.py | 12 ++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1b3a6c2..d01304e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,8 @@
* FIX: allow UTF-8 encoded permission translations
* FIX: Fixed several problems in OMD apache shared mode
* FIX: Do not use None$ as item when creating new rules
+ * FIX: Do load *all* users from htpasswd, so passwords from
+ users not created via WATO will not be lost.
Checks & Agents:
* hpux_if: fix missing default parameter errors
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d574fc3..9f30be0 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7005,7 +7005,11 @@ def load_users():
# Passwords are read directly from the apache htpasswd-file.
# That way heroes of the command line will still be able to
- # change passwords with htpasswd.
+ # change passwords with htpasswd. Users *only* appearing
+ # in htpasswd will also be loaded and assigned to the role
+ # they are getting according to the multisite old-style
+ # configuration variables.
+
filename = defaults.htpasswd_file
if os.path.exists(filename):
for line in file(filename):
@@ -7018,12 +7022,12 @@ def load_users():
if id in result:
result[id]["password"] = password
result[id]["locked"] = locked
- elif id in config.admin_users:
+ else:
# Create entry if this is an admin user
new_user = {
- "roles" : [ "admin" ],
+ "roles" : config.roles_of_user(id),
"password" : password,
- "locked" : False
+ "locked" : False
}
result[id] = new_user
# Other unknown entries will silently be dropped. Sorry...