Skip to content
Snippets Groups Projects
Commit e3ce6ce2 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

only pass needed variables to templates

parent 5b2c49f9
No related branches found
No related tags found
No related merge requests found
......@@ -85,10 +85,20 @@ sub execute {
# initialize output parameters
$self->{out} = {
url_cgi => $ENV{SCRIPT_NAME},
env => \%ENV,
actions => \%actions,
conf => $self->{configuration},
env => {
REMOTE_HOST => $ENV{REMOTE_HOST},
REMOTE_ADDR => $ENV{REMOTE_ADDR},
SCRIPT_NAME => $ENV{SCRIPT_NAME}
},
conf => {
accounts_validity_period => $self->{configuration}->{accounts_validity_period},
app_name => $self->{configuration}->{app_name},
app_url => $self->{configuration}->{app_url},
idp_scope => $self->{configuration}->{idp_scope},
idp_displayname => $self->{configuration}->{idp_displayname},
support_email => $self->{configuration}->{support_email},
version => $self->{configuration}->{version},
}
};
# process input parameters
......@@ -152,13 +162,6 @@ sub respond {
my ($self) = @_;
$self->{logger}->log(level => LOG_DEBUG, message => "");
## Automatic pass object entries to the output hash
foreach my $key (keys %{$self}) {
$self->{out}{$key} ||= $self->{$key}
unless ($key eq 'out');
}
## Parse template
my $tt2 = Template->new(
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment