On Sun, Jul 13, 2008 at 10:23 PM, <[EMAIL PROTECTED]> wrote:
> Dear All,
>
>
>
> I'm planning to develop a system that public users can fully change the
> template by their own.
>
>
>
> I'm concerning about security, how can I turn off some plugins or load only
> what I need?
>
> Derive your own plugin provider from Template::Plugins that declines
requests you don't want fulfilled. Here's one that declines everything:
use Template;
use Template::Plugins;
use Template::Constants;
use strict;
package MyPlugins;
our @ISA = qw(Template::Plugins);
sub fetch {
return (undef, Template::Constants::STATUS_DECLINED);
}
package main;
my $t = Template->new({ LOAD_PLUGINS => 'MyPlugins' });
$t->process(\'[% USE Date %]') or die $t->error;
This dies with "plugin error - Date: plugin not found".
--Sean
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates