X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FDashboards%2FElements%2FShowPortlet%2Fcomponent;h=0667f0d5fe2808d9760c726b551d283351c28680;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=81614a24b6bf4b180d60018c935a5e1d20c28bef;hpb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;p=freeside.git diff --git a/rt/share/html/Dashboards/Elements/ShowPortlet/component b/rt/share/html/Dashboards/Elements/ShowPortlet/component index 81614a24b..0667f0d5f 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-2019 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); +% }