X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_cert.cgi;h=28a269bcce2baee057eac16dc0c1132c93b10715;hp=36f598b9a8eface278051859af1f907a384a30be;hb=874ad675da1321638b374d0b574231d7fa577196;hpb=cd91e59d897b1359dd91b2b9e5e7e008d2dbd9ed
diff --git a/httemplate/view/svc_cert.cgi b/httemplate/view/svc_cert.cgi
index 36f598b9a..28a269bcc 100644
--- a/httemplate/view/svc_cert.cgi
+++ b/httemplate/view/svc_cert.cgi
@@ -34,8 +34,8 @@ my @fields = (
'value'=> sub {
my $svc_cert = shift;
if ( $svc_cert->csr ) { #display the subject etc?
- ''. $svc_cert->csr.
- '
';
+ '
'. "\n". $svc_cert->csr.
+ '
';
} elsif ( $svc_cert->common_name ) {
my $svcnum = $svc_cert->svcnum;
qq(Generate);
@@ -50,15 +50,60 @@ my @fields = (
if ( $svc_cert->certificate ) {
my %hash = $svc_cert->check_certificate;
- my $out = ''; #XXX better formatting
- foreach my $key ( keys %hash ) {
- $out .= "$key | $hash{$key} |
";
+
+ tie my %w, 'Tie::IxHash',
+ 'subject' => 'Issued to',
+ 'issuer' => 'Issued by',
+ ;
+
+ my $out = '';
+
+ foreach my $w ( keys %w ) {
+
+ $out .= include('/elements/table-grid.html'). #''.
+ ''.
+ $w{$w}. ' | ';
+
+ my $col = $svc_cert->subj_col;
+
+ my $subj = $hash{$w};
+ foreach my $key (keys %$col) { #( keys %$subj ) {
+ $out .= "". $labels{$col->{$key}}. " | ".
+ "". $subj->{$key}. " | ";
+ }
+
+ $out .= ' | ';
}
- $out .= ' |
';
+ $out .= '
';
+
+ $out .= ''.
+ 'Serial number | '.
+ "$hash{serial} |
".
+ 'Valid | '.
+ "$hash{notBefore} - $hash{notAfter} |
".
+ '
';
- $out .= ''.
+ if ( $hash{'selfsigned'} ) {
+ my $svcnum = $svc_cert->svcnum;
+ $out .= qq(
Re-generate self-signed).
+ ' '.
+ include('/elements/popup_link.html', {
+ 'action' => $p."edit/svc_cert/import_certificate.html".
+ "?svcnum=$svcnum",
+ 'label' => 'Import issued certificate', #link
+ 'actionlabel' => 'Import issued certificate', #title
+ #opt
+ 'width' => '544',
+ 'height' => '368',
+ #'color' => '#ff0000',
+ }).
+ '
';
+ }
+
+ $out .= ''.
$svc_cert->certificate.
- '
';
+ '';
+
$out;
} elsif ( $svc_cert->csr ) {
my $svcnum = $svc_cert->svcnum;