summaryrefslogtreecommitdiff
path: root/rt/share/html/Dashboards/Elements/ShowPortlet
diff options
context:
space:
mode:
Diffstat (limited to 'rt/share/html/Dashboards/Elements/ShowPortlet')
-rw-r--r--rt/share/html/Dashboards/Elements/ShowPortlet/component14
-rw-r--r--rt/share/html/Dashboards/Elements/ShowPortlet/dashboard3
-rw-r--r--rt/share/html/Dashboards/Elements/ShowPortlet/search2
3 files changed, 14 insertions, 5 deletions
diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/component b/rt/share/html/Dashboards/Elements/ShowPortlet/component
index 81614a24b..3b54da21a 100644
--- a/rt/share/html/Dashboards/Elements/ShowPortlet/component
+++ b/rt/share/html/Dashboards/Elements/ShowPortlet/component
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -51,4 +51,14 @@ $Portlet
$Rows => 20
$Preview => 0
</%args>
-% $m->comp($Portlet->{path});
+<%init>
+my $full_path = $Portlet->{path};
+(my $path = $full_path) =~ s{^/Elements/}{};
+
+my $allowed = grep { $_ eq $path } @{RT->Config->Get('HomepageComponents')};
+</%init>
+% if (!$allowed) {
+% $m->out( $m->interp->apply_escapes( loc("Invalid portlet [_1]", $path), "h" ) );
+% } else {
+% $m->comp($full_path);
+% }
diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard b/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
index c9de6dfbd..3c35ea891 100644
--- a/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
+++ b/rt/share/html/Dashboards/Elements/ShowPortlet/dashboard
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -56,7 +56,6 @@ $Depth => 0
<%init>
my $current_dashboard;
-use Scalar::Util 'blessed';
if (blessed($Portlet) && $Portlet->isa('RT::Dashboard')) {
$current_dashboard = $Portlet;
}
diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/search b/rt/share/html/Dashboards/Elements/ShowPortlet/search
index 416476c86..d190295d7 100644
--- a/rt/share/html/Dashboards/Elements/ShowPortlet/search
+++ b/rt/share/html/Dashboards/Elements/ShowPortlet/search
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)