summaryrefslogtreecommitdiff
path: root/httemplate/view/svc_cert.cgi
diff options
context:
space:
mode:
authorivan <ivan>2010-11-07 05:30:12 +0000
committerivan <ivan>2010-11-07 05:30:12 +0000
commitcd91e59d897b1359dd91b2b9e5e7e008d2dbd9ed (patch)
tree0d22c6b82e55fcc08d752bb198a8ac8050179548 /httemplate/view/svc_cert.cgi
parent2d73473ce78c22160b618e93802a9551c9c77d69 (diff)
certificates ala communigate, RT#7515
Diffstat (limited to 'httemplate/view/svc_cert.cgi')
-rw-r--r--httemplate/view/svc_cert.cgi41
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>