RT notifier: parse templates without header correctly
[openxpki.git] / trunk / clients / perl / OpenXPKI-Client-HTML-Mason / htdocs / binary / get_chain.html
blob5d24ef9195fd4f9d5322fba20c8683b96357834d
1 <%args>
2 $identifier => undef
3 </%args>
4 <%init>
5 my $filename = $m->comp('/lib/filename_for_cert.mhtml',
6 'identifier' => $identifier,
7 'extension' => 'pem',
8 'chain' => 1,
9 );
10 ## request the chain from the server
11 my $msg = $context->{client}->send_receive_command_msg (
12 "get_chain",
13 {'START_IDENTIFIER' => $identifier,
14 'OUTFORMAT' => 'PEM'});
15 my $item = join "\n", @{$msg->{PARAMS}->{CERTIFICATES}};
17 ## now send the stuff
18 eval {
19 $r->header_out('Content-Disposition' => ("attachment; filename=$filename"));
21 if ($EVAL_ERROR) {
22 # mod_perl 2
23 $r->headers_out->add('Content-Disposition' => ("attachment; filename=$filename"));
25 $r->content_type ("text/plain");
26 print $item;
27 return 1;
28 </%init>
29 <%once>
30 use English;
31 </%once>