% include('elements/svc_Common.html',
'table' => 'svc_cert',
'labels' => \%labels,
#'html_foot' => $html_foot,
'fields' => \@fields,
)
%>
<%init>
my $fields = FS::svc_cert->table_info->{'fields'};
my %labels = map { $_ => ( ref($fields->{$_})
? $fields->{$_}{'label'}
: $fields->{$_}
);
}
keys %$fields;
my @fields = (
{ field=>'privatekey',
value=> sub {
my $svc_cert = shift;
if ( $svc_cert->privatekey && $svc_cert->check_privatekey ) {
'Verification OK';
} elsif ( $svc_cert->privatekey ) {
'Verification error';
} else {
'(none)';
}
},
},
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?
''. $svc_cert->csr.
'
';
} elsif ( $svc_cert->common_name ) {
my $svcnum = $svc_cert->svcnum;
qq(Generate);
} else {
'';
}
},
},
{ 'field'=>'certificate',
'value'=> sub {
my $svc_cert = shift;
if ( $svc_cert->certificate ) {
my %hash = $svc_cert->check_certificate;
my $out = '
$key | $hash{$key} |
'. $svc_cert->certificate. ''; $out; } elsif ( $svc_cert->csr ) { my $svcnum = $svc_cert->svcnum; qq(Generate self-signed); } else { ''; } }, }, ); %init>