Module: check_mk
Branch: master
Commit: 0914b07a2a7e38e7ffa31329c1dad2647a77ccda
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0914b07a2a7e38…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 17 16:23:16 2014 +0100
#1788 New personal setting for start page, right after login
A user can now configure an alternative start URL in his personal
settings. Default is <tt>dashboard.py</tt> (which can changed in the
global setting). Only relative URLs are allowed.
---
.werks/1788 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/main.py | 5 +++--
web/htdocs/sidebar.py | 2 +-
web/plugins/userdb/user_attributes.py | 10 ++++++++++
5 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/.werks/1788 b/.werks/1788
new file mode 100644
index 0000000..5d6fd21
--- /dev/null
+++ b/.werks/1788
@@ -0,0 +1,12 @@
+Title: New personal setting for start page, right after login
+Level: 2
+Component: multisite
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1418829739
+
+A user can now configure an alternative start URL in his personal
+settings. Default is <tt>dashboard.py</tt> (which can changed in the
+global setting). Only relative URLs are allowed.
diff --git a/ChangeLog b/ChangeLog
index 3a4744a..1f8831a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
+ * 1788 New personal setting for start page, right after login...
* 1781 FIX: Fix broken grouping by host/service group in availability
* 1783 FIX: Finish the view "History of Scheduled Downtimes"...
* 1206 FIX: Hostname not longer shown as column in host views
diff --git a/web/htdocs/main.py b/web/htdocs/main.py
index 85fc2e4..89091f9 100644
--- a/web/htdocs/main.py
+++ b/web/htdocs/main.py
@@ -27,11 +27,12 @@
import defaults, config
def page_index():
- start_url = html.var("start_url", config.start_url)
+ default_start_url = config.user.get("start_url") or config.start_url
+ start_url = html.var("start_url", default_start_url)
# Prevent redirecting to absolute URL which could be used to redirect
# users to compromised pages
if '://' in start_url:
- start_url = config.start_url
+ start_url = default_start_url
# Do not cache the index page -> caching problems when page is accessed
# while not logged in
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 132e0f0..793dac0 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -158,7 +158,7 @@ def sidebar_head():
html.write('<a title="%s" target="main"
href="%s">'
'<div id="side_version">%s</div>'
'</a>'
- '</div>\n' % (_("Go to main overview"),
html.attrencode(config.start_url), defaults.check_mk_version))
+ '</div>\n' % (_("Go to main overview"),
html.attrencode(config.user.get("start_url") or config.start_url),
defaults.check_mk_version))
def render_messages():
for msg in notify.get_gui_messages():
diff --git a/web/plugins/userdb/user_attributes.py
b/web/plugins/userdb/user_attributes.py
index bc67d7d..ec5224d 100644
--- a/web/plugins/userdb/user_attributes.py
+++ b/web/plugins/userdb/user_attributes.py
@@ -64,4 +64,14 @@ declare_user_attribute(
domain = "check_mk",
)
+declare_user_attribute(
+ "start_url",
+ TextAscii(title = _("Start-URL to display in main frame"),
+ help = _("When you point your browser to the Multisite GUI, usually
the dashboard "
+ "is shown in the main (right) frame. You can replace this
with any other "
+ "URL you like here."),
+ size = 80,
+ default_value = "dashboard.py",
+ attrencode = True),
+ domain = "multisite")