certificates ala communigate, RT#7515
[freeside.git] / httemplate / view / svc_cert.cgi
1 <% include('elements/svc_Common.html',
2              'table'     => 'svc_cert',
3              'labels'    => \%labels,
4              #'html_foot' => $html_foot,
5              'fields' => \@fields,
6           )
7 %>
8 <%init>
9
10 my $fields = FS::svc_cert->table_info->{'fields'};
11 my %labels = map { $_ =>  ( ref($fields->{$_})
12                              ? $fields->{$_}{'label'}
13                              : $fields->{$_}
14                          );
15                  }
16              keys %$fields;
17
18 my @fields = (
19   { field=>'privatekey',
20     value=> sub {
21       my $svc_cert = shift;
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>';
26       } else {
27         '<I>(none)</I>';
28       }
29     },
30   },
31   qw( organization organization_unit city state country cert_contact )
32 );
33
34 </%init>