diff options
Diffstat (limited to 'httemplate/view/svc_cert.cgi')
-rw-r--r-- | httemplate/view/svc_cert.cgi | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/httemplate/view/svc_cert.cgi b/httemplate/view/svc_cert.cgi index 92902d6d2..36f598b9a 100644 --- a/httemplate/view/svc_cert.cgi +++ b/httemplate/view/svc_cert.cgi @@ -28,7 +28,46 @@ my @fields = ( } }, }, - qw( organization organization_unit city state country cert_contact ) + qw( common_name organization organization_unit city state country cert_contact + ), + { 'field'=>'csr', + 'value'=> sub { + my $svc_cert = shift; + if ( $svc_cert->csr ) { #display the subject etc? + '<FONT STYLE="font-family:monospace"><PRE>'. $svc_cert->csr. + '</PRE></FONT>'; + } elsif ( $svc_cert->common_name ) { + my $svcnum = $svc_cert->svcnum; + qq(<A HREF="${p}misc/svc_cert-generate.html?action=generate_csr;svcnum=$svcnum">Generate</A>); + } else { + ''; + } + }, + }, + { 'field'=>'certificate', + 'value'=> sub { + my $svc_cert = shift; + if ( $svc_cert->certificate ) { + + my %hash = $svc_cert->check_certificate; + my $out = '<TABLE>'; #XXX better formatting + foreach my $key ( keys %hash ) { + $out .= "<TR><TD>$key</TD><TD>$hash{$key}</TD></TR>"; + } + $out .= '</TABLE>'; + + $out .= '<FONT STYLE="font-family:monospace"><PRE>'. + $svc_cert->certificate. + '</PRE></FONT>'; + $out; + } elsif ( $svc_cert->csr ) { + my $svcnum = $svc_cert->svcnum; + qq(<A HREF="${p}misc/svc_cert-generate.html?action=generate_selfsigned;svcnum=$svcnum">Generate self-signed</A>); + } else { + ''; + } + }, + }, ); </%init> |