diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm index 470e6cec4cfc0b632a291c81ca7655ec53485804..59d5bf255c3e30650de535d26a7609968563500c 100755 --- a/lib/IdPAccountManager/WebRequest.pm +++ b/lib/IdPAccountManager/WebRequest.pm @@ -159,49 +159,41 @@ sub respond { unless ($key eq 'out'); } - ## An action may redirect to an external URL - if ($self->{url_redirection}) { + ## Parse template + my $tt2 = Template->new( + { + ENCODING => 'iso-8859-1', ## le défaut apparemment + FILTERS => { + encode_utf8 => + [ \&IdPAccountManager::Tools::encode_utf8, 0 ], + escape_quotes => + [ \&IdPAccountManager::Tools::escape_quotes, 0 ] + }, + INCLUDE_PATH => $self->{configuration}->{root_manager_dir} . ':' + . $self->{configuration}->{root_manager_dir} + . '/templates/accountProfiles', + + #DEBUG => 'all', + #DEBUG => 'caller', + #DEBUG => 'parser' + } + ); - printf "Location: %s\n\n", $self->{url_redirection}; + my $template; + ## nobanner is used to do AJAX to get only pieces of HTML to load in the web client + if ($self->{in}->{style} eq 'nobanner') { + $template = 'templates/web/index-nobanner.tt2.html'; } else { + $template = 'templates/web/index.tt2.html'; + } - ## Parse template - my $tt2 = Template->new( - { - ENCODING => 'iso-8859-1', ## le défaut apparemment - FILTERS => { - encode_utf8 => - [ \&IdPAccountManager::Tools::encode_utf8, 0 ], - escape_quotes => - [ \&IdPAccountManager::Tools::escape_quotes, 0 ] - }, - INCLUDE_PATH => $self->{configuration}->{root_manager_dir} . ':' - . $self->{configuration}->{root_manager_dir} - . '/templates/accountProfiles', - - #DEBUG => 'all', - #DEBUG => 'caller', - #DEBUG => 'parser' - } + unless ($tt2->process($template, $self->{out}, \*STDOUT)) { + printf "Content-type: text/plain\n\n Error: %s", $tt2->error(); + $self->{logger}->log( + level => LOG_ERROR, + message => sprintf("Web parser error : %s", $tt2->error()) ); - - my $template; - - ## nobanner is used to do AJAX to get only pieces of HTML to load in the web client - if ($self->{in}->{style} eq 'nobanner') { - $template = 'templates/web/index-nobanner.tt2.html'; - } else { - $template = 'templates/web/index.tt2.html'; - } - - unless ($tt2->process($template, $self->{out}, \*STDOUT)) { - printf "Content-type: text/plain\n\n Error: %s", $tt2->error(); - $self->{logger}->log( - level => LOG_ERROR, - message => sprintf("Web parser error : %s", $tt2->error()) - ); - } } ## Ignore some type of errors