1 <% include('elements/svc_Common.html',
4 #'html_foot' => $html_foot,
10 my $fields = FS::svc_cert->table_info->{'fields'};
11 my %labels = map { $_ => ( ref($fields->{$_})
12 ? $fields->{$_}{'label'}
19 { field=>'privatekey',
22 if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) {
23 '<FONT COLOR="#33ff33">Verification OK</FONT>';
24 } elsif ( $svc_cert->privatekey ) {
25 '<FONT COLOR="#ff0000">Verification error</FONT>';
31 qw( common_name organization organization_unit city state country cert_contact
36 if ( $svc_cert->csr ) { #display the subject etc?
37 '<PRE><FONT STYLE="font-family:monospace">'. "\n". $svc_cert->csr.
39 } elsif ( $svc_cert->common_name ) {
40 my $svcnum = $svc_cert->svcnum;
41 qq(<A HREF="${p}misc/svc_cert-generate.html?action=generate_csr;svcnum=$svcnum">Generate</A>);
47 { 'field'=>'certificate',
50 if ( $svc_cert->certificate ) {
52 my %hash = $svc_cert->check_certificate;
54 tie my %w, 'Tie::IxHash',
55 'subject' => 'Issued to',
56 'issuer' => 'Issued by',
59 my $out = '<TABLE><TR><TD>';
61 foreach my $w ( keys %w ) {
63 $out .= include('/elements/table-grid.html'). #'<TABLE>'.
64 '<TR><TH COLSPAN=2 BGCOLOR="#cccccc" ALIGN="center">'.
67 my $col = $svc_cert->subj_col;
70 foreach my $key (keys %$col) { #( keys %$subj ) {
71 $out .= "<TR><TD>". $labels{$col->{$key}}. "</TD>".
72 "<TD>". $subj->{$key}. "</TD></TR>";
75 $out .= '</TABLE></TD><TD>';
77 $out .= '</TD></TR></TABLE>';
80 '<TR><TH ALIGN="right">Serial number</TH>'.
81 "<TD>$hash{serial}</TD></TR>".
82 '<TR><TH ALIGN="right">Valid</TH>'.
83 "<TD>$hash{notBefore} - $hash{notAfter}</TD></TR>".
86 if ( $hash{'selfsigned'} ) {
87 my $svcnum = $svc_cert->svcnum;
88 $out .= qq(<BR> <A HREF="${p}misc/svc_cert-generate.html?action=generate_selfsigned;svcnum=$svcnum">Re-generate self-signed</A>).
90 include('/elements/popup_link.html', {
91 'action' => $p."edit/svc_cert/import_certificate.html".
93 'label' => 'Import issued certificate', #link
94 'actionlabel' => 'Import issued certificate', #title
98 #'color' => '#ff0000',
103 $out .= '<PRE><FONT STYLE="font-family:monospace">'.
104 $svc_cert->certificate.
108 } elsif ( $svc_cert->csr ) {
109 my $svcnum = $svc_cert->svcnum;
110 qq(<A HREF="${p}misc/svc_cert-generate.html?action=generate_selfsigned;svcnum=$svcnum">Generate self-signed</A>);