summaryrefslogtreecommitdiff
path: root/httemplate/view/svc_cert.cgi
blob: 92902d6d273f6faf0a085c4944c94ed3ef027630 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<% 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 ) {
        '<FONT COLOR="#33ff33">Verification OK</FONT>';
      } elsif ( $svc_cert->privatekey ) {
        '<FONT COLOR="#ff0000">Verification error</FONT>';
      } else {
        '<I>(none)</I>';
      }
    },
  },
  qw( organization organization_unit city state country cert_contact )
);

</%init>