Module: check_mk
Branch: master
Commit: 26e013e91b0609925a359f2ea49411ec2dede7ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26e013e91b0609…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 20 15:06:23 2013 +0200
auth.php: always adding roles - as expected
---
web/htdocs/config.py | 7 +++++++
web/htdocs/userdb.py | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 25dfd8d..027ec51 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -328,6 +328,13 @@ def get_role_permissions():
# Loop all permissions
# and for each permission loop all roles
# and check wether it has the permission or not
+
+ # Make sure, builtin roles are present, even if not modified
+ # and saved with WATO.
+ for br in builtin_role_ids:
+ if br not in roles:
+ roles[br] = {}
+
roleids = roles.keys()
for perm in permissions_by_order:
for role_id in roleids:
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 5063b53..f864524 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -583,7 +583,7 @@ def general_page_hook():
# This is a good place to replace old api based files in the future.
auth_php = defaults.var_dir + '/wato/auth/auth.php'
if not os.path.exists(auth_php) or os.path.getsize(auth_php) == 0:
- create_auth_file(load_users())
+ create_auth_file("page_hook", load_users())
# Create initial auth.serials file, same issue as auth.php above
serials_file = '%s/auth.serials' % os.path.dirname(defaults.htpasswd_file)