Module: check_mk
Branch: master
Commit: a5a3bb6086e6a7844e2c379fdba8a60bfdf27ff9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a5a3bb6086e6a7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 18 11:32:10 2012 +0100
FIX: Creating auth.php file on first login dialog based login to ensure
it exists after login when it is first needed
---
ChangeLog | 2 ++
web/htdocs/login.py | 10 ++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8c6dcd8..bba9e47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,8 @@
* FIX: Fixed auth problem when following logwatch icon links while using
the form based auth
* FIX: Fix problem with Umlaut in contact alias
+ * FIX: Creating auth.php file on first login dialog based login to ensure
+ it exists after login when it is first needed
Mobile:
* Improved sorting of views in main page
diff --git a/web/htdocs/login.py b/web/htdocs/login.py
index 7d92280..0f74f53 100644
--- a/web/htdocs/login.py
+++ b/web/htdocs/login.py
@@ -202,6 +202,16 @@ def page_login():
return normal_login_page()
def normal_login_page():
+ # Working around the problem that the auth.php file needed for multisite based
+ # authorization of external addons might not exist when setting up a new
installation
+ # We assume: Each user must visit this login page before using the multisite based
+ # authorization. So we can easily create the file here if it is missing.
+ # This is a good place to replace old api based files in the future.
+ if not os.path.exists(defaults.var_dir + '/wato/auth/auth.php'):
+ import wato
+ wato.load_plugins()
+ wato.create_auth_file(wato.load_users())
+
html.set_render_headfoot(False)
html.header(_("Check_MK Multisite Login"), javascripts=[],
stylesheets=["pages", "login"])