[freeside-commits] freeside/httemplate/view svc_cert.cgi,1.2,1.3
Ivan,,,
ivan at wavetail.420.am
Sun Nov 7 15:47:05 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv1230/httemplate/view
Modified Files:
svc_cert.cgi
Log Message:
certificates ala communigate, RT#7515
Index: svc_cert.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/svc_cert.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- svc_cert.cgi 7 Nov 2010 05:30:11 -0000 1.2
+++ svc_cert.cgi 7 Nov 2010 23:47:03 -0000 1.3
@@ -34,8 +34,8 @@
'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>';
+ '<PRE><FONT STYLE="font-family:monospace">'. "\n". $svc_cert->csr.
+ '</FONT></PRE>';
} 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>);
@@ -50,15 +50,60 @@
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>";
+
+ tie my %w, 'Tie::IxHash',
+ 'subject' => 'Issued to',
+ 'issuer' => 'Issued by',
+ ;
+
+ my $out = '<TABLE><TR><TD>';
+
+ foreach my $w ( keys %w ) {
+
+ $out .= include('/elements/table-grid.html'). #'<TABLE>'.
+ '<TR><TH COLSPAN=2 BGCOLOR="#cccccc" ALIGN="center">'.
+ $w{$w}. '</TH></TR>';
+
+ my $col = $svc_cert->subj_col;
+
+ my $subj = $hash{$w};
+ foreach my $key (keys %$col) { #( keys %$subj ) {
+ $out .= "<TR><TD>". $labels{$col->{$key}}. "</TD>".
+ "<TD>". $subj->{$key}. "</TD></TR>";
}
- $out .= '</TABLE>';
- $out .= '<FONT STYLE="font-family:monospace"><PRE>'.
+ $out .= '</TABLE></TD><TD>';
+ }
+ $out .= '</TD></TR></TABLE>';
+
+ $out .= '<TABLE>'.
+ '<TR><TH ALIGN="right">Serial number</TH>'.
+ "<TD>$hash{serial}</TD></TR>".
+ '<TR><TH ALIGN="right">Valid</TH>'.
+ "<TD>$hash{notBefore} - $hash{notAfter}</TD></TR>".
+ '</TABLE>';
+
+ if ( $hash{'selfsigned'} ) {
+ my $svcnum = $svc_cert->svcnum;
+ $out .= qq(<BR> <A HREF="${p}misc/svc_cert-generate.html?action=generate_selfsigned;svcnum=$svcnum">Re-generate self-signed</A>).
+ ' '.
+ 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',
+ }).
+ '<BR>';
+ }
+
+ $out .= '<PRE><FONT STYLE="font-family:monospace">'.
$svc_cert->certificate.
- '</PRE></FONT>';
+ '</FONT><PRE>';
+
$out;
} elsif ( $svc_cert->csr ) {
my $svcnum = $svc_cert->svcnum;
More information about the freeside-commits
mailing list