Module: check_mk
Branch: master
Commit: 7b8c68ab3d0659955cbb013ed41fe004e30427f6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b8c68ab3d0659…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 29 01:01:04 2014 +0200
FIX Fixed handling of exceptions occuring before login in debug mode
---
.werks/811 | 8 ++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 6 ++++--
web/htdocs/index.py | 1 +
web/htdocs/login.py | 2 +-
5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/811 b/.werks/811
new file mode 100644
index 0000000..7a0acfc
--- /dev/null
+++ b/.werks/811
@@ -0,0 +1,8 @@
+Title: Fixed handling of exceptions occuring before login in debug mode
+Level: 1
+Component: multisite
+Version: 1.2.5i3
+Date: 1398726038
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index e7698e8..e193e5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,7 @@
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled
by filter)
* 0887 Add new column painter "Host Notifications Enabled"...
+ * 0811 FIX: Fixed handling of exceptions occuring before login in debug mode
WATO:
* 0784 Improved security of WATO bulk inventory by using transaction ids
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 488852f..18765ed 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1095,7 +1095,8 @@ class html:
self.lowlevel_write("<tr><th colspan=2>POST / GET
Variables</th></tr>")
for name, value in sorted(self.vars.items()):
if not prefix or name.startswith(prefix):
- self.write("<tr><td class=left>%s</td><td
class=right>%s</td></tr>\n" % (name, value))
+ self.write("<tr><td class=left>%s</td><td
class=right>%s</td></tr>\n" %
+ (self.attrencode(name), self.attrencode(value)))
self.write("</table>")
def var(self, varname, deflt = None):
@@ -1240,7 +1241,8 @@ class html:
def begin_foldable_container(self, treename, id, isopen, title, indent=True,
first=False, icon=None, fetch_url=None):
self.folding_indent = indent
- isopen = self.foldable_container_is_open(treename, id, isopen)
+ if self.user:
+ isopen = self.foldable_container_is_open(treename, id, isopen)
img_num = isopen and "90" or "00"
onclick = ' onclick="toggle_foldable_container(\'%s\',
\'%s\', \'%s\')"' % (
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 0f1b25e..3c97a02 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -104,6 +104,7 @@ def handler(req, fields = None, profiling = True):
config.load_config() # load multisite.mk
if html.var("debug"): # Debug flag may be set via URL
config.debug = True
+ html.enable_debug = config.debug
html.set_buffering(config.buffered_http_stream)
# profiling can be enabled in multisite.mk
diff --git a/web/htdocs/login.py b/web/htdocs/login.py
index 55452c0..00aa5dc 100644
--- a/web/htdocs/login.py
+++ b/web/htdocs/login.py
@@ -131,7 +131,7 @@ def check_auth_automation():
# Auth with automation secret succeeded - mark transid as unneeded in this
case
html.set_ignore_transids()
return user
- raise MKAuthException(_("Invalid automation secret for user %s") % user)
+ raise MKAuthException(_("Invalid automation secret for user %s") %
html.attrencode(user))
def check_auth():
if html.var("_secret"):