X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FDashboards%2FElements%2FShowPortlet%2Fcomponent;h=37989338620455b05caeeda48bb681cd51db58c5;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=5218843f81403603e88fcdeb266d79af46442280;hpb=73a6a80a9ca5edbd43d139b7cb25bfee4abfd35e;p=freeside.git diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/component b/rt/share/html/Dashboards/Elements/ShowPortlet/component index 5218843f8..379893386 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-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -51,4 +51,14 @@ $Portlet $Rows => 20 $Preview => 0 -% $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')}; + +% if (!$allowed) { +% $m->out( $m->interp->apply_escapes( loc("Invalid portlet [_1]", $path), "h" ) ); +% } else { +% $m->comp($full_path); +% }