certificates ala communigate, RT#7515
authorivan <ivan>
Mon, 8 Nov 2010 05:24:06 +0000 (05:24 +0000)
committerivan <ivan>
Mon, 8 Nov 2010 05:24:06 +0000 (05:24 +0000)
FS/FS/Schema.pm
FS/FS/part_export/communigate_pro.pm
FS/FS/svc_CGP_Mixin.pm
FS/FS/svc_domain.pm
httemplate/edit/svc_domain/communigate-basics.html
httemplate/view/svc_domain/basics.html

index 4c85da1..b8ba5b2 100644 (file)
@@ -1775,6 +1775,7 @@ sub tables_hashref {
         'trailer',         'text', 'NULL',       '', '', '',
         'cgp_aliases',  'varchar', 'NULL',      255, '', '',
         'cgp_accessmodes','varchar','NULL',     255, '', '', #DomainAccessModes
         'trailer',         'text', 'NULL',       '', '', '',
         'cgp_aliases',  'varchar', 'NULL',      255, '', '',
         'cgp_accessmodes','varchar','NULL',     255, '', '', #DomainAccessModes
+        'cgp_certificatetype','varchar','NULL', $char_d, '', '',
         #settings
         'acct_def_password_selfchange',   'char', 'NULL',       1,  '', '', 
         'acct_def_password_recover',      'char', 'NULL',       1, 'Y', '', 
         #settings
         'acct_def_password_selfchange',   'char', 'NULL',       1,  '', '', 
         'acct_def_password_recover',      'char', 'NULL',       1, 'Y', '', 
index cc96086..a3ec5e0 100644 (file)
@@ -173,6 +173,8 @@ sub _export_insert_svc_domain {
     if $svc_domain->parent_svcnum;
   $settings{'TrailerText'} = $svc_domain->trailer
     if $svc_domain->trailer;
     if $svc_domain->parent_svcnum;
   $settings{'TrailerText'} = $svc_domain->trailer
     if $svc_domain->trailer;
+  $settings{'CertificateType'} = $svc_domain->cgp_certificatetype
+    if $svc_domain->cgp_certificatetype;
 
   my @options = ( $create, $svc_domain->domain, \%settings );
 
 
   my @options = ( $create, $svc_domain->domain, \%settings );
 
@@ -426,6 +428,8 @@ sub _export_replace_svc_domain {
   $settings{'AdminDomainName'} =
     $new->parent_svcnum ? $new->parent_svc_x->domain : ''
       if $old->parent_svcnum != $new->parent_svcnum;
   $settings{'AdminDomainName'} =
     $new->parent_svcnum ? $new->parent_svc_x->domain : ''
       if $old->parent_svcnum != $new->parent_svcnum;
+  $settings{'CertificateType'} = $new->cgp_certificatetype
+    if $old->cgp_certificatetype ne $new->cgp_certificatetype;
 
   if ( keys %settings ) {
     my $error = $self->communigate_pro_queue( $new->svcnum,
 
   if ( keys %settings ) {
     my $error = $self->communigate_pro_queue( $new->svcnum,
index 489e979..2eee37a 100644 (file)
@@ -131,6 +131,24 @@ sub cgp_emptytrash_values {
   ];
 }
 
   ];
 }
 
+=item cgp_certificatetype_values
+
+Returns an arrayref of possible CertificateType values.
+
+=cut
+
+#http://www.communigate.com/cgatepro/PKI.html
+
+sub cgp_certificatetype_values {
+
+  [ '', #<option value="-1">default(Test)
+    'Enabled',
+    'Disabled',
+    'Test',
+  ];
+
+}
+
 =back
 
 =head1 BUGS
 =back
 
 =head1 BUGS
index dde6d3c..a97f35b 100644 (file)
@@ -133,6 +133,13 @@ sub table_info {
                              disable_inventory => 1,
                              disable_select    => 1,
                            },
                              disable_inventory => 1,
                              disable_select    => 1,
                            },
+      'cgp_certificatetype' => { 
+                             label => 'Communigate PKI services',
+                             type  => 'select',
+                             select_list => __PACKAGE__->cgp_certificatetype_values,
+                             disable_inventory => 1,
+                             disable_select    => 1,
+                           },
 
       'acct_def_cgp_accessmodes' => { 
                              label => 'Acct. default Communigate enabled services',
 
       'acct_def_cgp_accessmodes' => { 
                              label => 'Acct. default Communigate enabled services',
index ff401c0..dbad35f 100644 (file)
 % }
 
 % if ( $communigate
 % }
 
 % if ( $communigate
+%      && $part_svc->part_svc_column('cgp_certificatetype')->columnflag ne 'F' )
+% {
+
+  <% include('/elements/tr-select.html',
+               'label'      => 'PKI services',
+               'field'      => 'cgp_certificatetype',
+               'options'    => $svc_domain->cgp_certificatetype_values,
+               'labels'     => {
+                                 '' => 'default (Test)',
+                               },
+               'curr_value' => $svc_domain->cgp_certificatetype,
+            )
+  %>
+% } else {
+    <INPUT TYPE="hidden" NAME="cgp_certificatetype" VALUE="<% $svc_domain->cgp_certificatetype() |h %>">
+% }
+
+% if ( $communigate
 %      && $part_svc->part_svc_column('trailer')->columnflag ne 'F' )
 % {
 
 %      && $part_svc->part_svc_column('trailer')->columnflag ne 'F' )
 % {
 
index 1915719..71b7ca4 100644 (file)
@@ -86,6 +86,13 @@ Service #<B><% $svcnum %></B>
   </TR>
 % }
 
   </TR>
 % }
 
+% if ( $svc_domain->cgp_certificatetype ) {
+  <TR>
+    <TD ALIGN="right">PKI services</TD>
+    <TD BGCOLOR="#ffffff"><% $svc_domain->cgp_certificatetype %></TD>
+  </TR>
+% }
+
 % if ( $svc_domain->trailer ) {
   <TR>
     <TD ALIGN="right">Mail trailer</TD>
 % if ( $svc_domain->trailer ) {
   <TR>
     <TD ALIGN="right">Mail trailer</TD>