Module: check_mk
Branch: master
Commit: a4fa67ababc49a7dd2ff06786c00de559c265906
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4fa67ababc49a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 2 14:54:44 2018 +0100
5719 FIX The Start URL is now configured optionally for new users
There is either a global defaukt start URL for fresh logged in users set
in Check_MK. It is either <tt>dashboard.py</tt> by default or customized
using the global settings. There is also a user attribute to customize
this setting for each user individually.
The idea of this setting was to set the start URL attribute only in case
one wanted to override the global setting. But the attribute was set to
<tt>dashboard.py</tt> during creation of each new user, since the attribute
was not an optional one. If one then tried to change the global setting
it had no effect on the users, because they had all the start URL set to
<tt>dashboard.py</tt> individually.
This option has been made optionally now. It defaults to
<i>Use the default start URL</i> for new users.
Change-Id: I3d6ff8069d430aa331d6a0dd767d4d72c0e0ef1b
---
.werks/5719 | 23 +++++++++++++++++++++++
web/plugins/userdb/user_attributes.py | 30 +++++++++++++++++++++++-------
web/plugins/wato/check_mk_configuration.py | 4 ++--
3 files changed, 48 insertions(+), 9 deletions(-)
diff --git a/.werks/5719 b/.werks/5719
new file mode 100644
index 0000000..c50b7ef
--- /dev/null
+++ b/.werks/5719
@@ -0,0 +1,23 @@
+Title: The Start URL is now configured optionally for new users
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1517579382
+Class: fix
+
+There is either a global defaukt start URL for fresh logged in users set
+in Check_MK. It is either <tt>dashboard.py</tt> by default or customized
+using the global settings. There is also a user attribute to customize
+this setting for each user individually.
+
+The idea of this setting was to set the start URL attribute only in case
+one wanted to override the global setting. But the attribute was set to
+<tt>dashboard.py</tt> during creation of each new user, since the attribute
+was not an optional one. If one then tried to change the global setting
+it had no effect on the users, because they had all the start URL set to
+<tt>dashboard.py</tt> individually.
+
+This option has been made optionally now. It defaults to
+<i>Use the default start URL</i> for new users.
diff --git a/web/plugins/userdb/user_attributes.py
b/web/plugins/userdb/user_attributes.py
index da46cd9..039a7cc 100644
--- a/web/plugins/userdb/user_attributes.py
+++ b/web/plugins/userdb/user_attributes.py
@@ -82,11 +82,27 @@ declare_user_attribute(
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),
+ Transform(
+ Alternative(
+ title = _("Start URL to display in main frame"),
+ style = "dropdown",
+ orientation = "horizontal",
+ elements = [
+ FixedValue(None,
+ title = _("Use the default start URL"),
+ totext = "",
+ ),
+ TextAscii(
+ title = _("Use this custom start URL"),
+ help = _("When you point your browser to the Check_MK 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
+ ),
+ ],
+ ),
+ forth = lambda v: None if v == "" else v,
+ ),
domain = "multisite")
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 2c849e2..468e61b 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -278,8 +278,8 @@ register_configvar(group,
register_configvar(group,
"start_url",
- TextAscii(title = _("Start-URL to display in main frame"),
- help = _("When you point your browser to the Multisite GUI, usually
the dashboard "
+ TextAscii(title = _("Start URL to display in main frame"),
+ help = _("When you point your browser to the Check_MK GUI, usually the
dashboard "
"is shown in the main (right) frame. You can replace this
with any other "
"URL you like here."),
size = 80,