communigate provisioning phase 2: Domain:Account Defaults:Settings: RulesAllowed...
[freeside.git] / FS / FS / part_export / communigate_pro.pm
index 7f5cece..9ea8401 100644 (file)
@@ -141,6 +141,8 @@ sub _export_insert_svc_domain {
     if $svc_domain->max_accounts;
   $settings{'AdminDomainName'} = $svc_domain->parent_svc_x->domain
     if $svc_domain->parent_svcnum;
+  $settings{'TrailerText'} = $svc_domain->trailer
+    if $svc_domain->trailer;
 
   my @options = ( $create, $svc_domain->domain, \%settings );
 
@@ -169,6 +171,10 @@ sub _export_insert_svc_domain {
     'MaxWebSize'       => $svc_domain->acct_def_file_quota,
     'MaxWebFile'       => $svc_domain->acct_def_file_maxnum,
     'MaxFileSize'      => $svc_domain->acct_def_file_maxsize,
+    'RulesAllowed'     => $svc_domain->acct_def_cgp_rulesallowed,
+    'RPOPAllowed'      =>($svc_domain->acct_def_cgp_rpopallowed    ?'YES':'NO'),
+    'MailToAll'        =>($svc_domain->acct_def_cgp_mailtoall      ?'YES':'NO'),
+    'AddMailTrailer'   =>($svc_domain->acct_def_cgp_addmailtrailer ?'YES':'NO'),
   );
   warn "WARNING: error queueing SetAccountDefaults job: $def_err"
     if $def_err;
@@ -325,6 +331,8 @@ sub _export_replace_svc_domain {
   my %settings = ();
   $settings{'AccountsLimit'} = $new->max_accounts
     if $old->max_accounts ne $new->max_accounts;
+  $settings{'TrailerText'} = $new->trailer
+    if $old->trailer ne $new->trailer;
   $settings{'DomainAccessModes'} = $new->cgp_accessmodes
     if $old->cgp_accessmodes ne $new->cgp_accessmodes;
   $settings{'AdminDomainName'} =
@@ -364,6 +372,10 @@ sub _export_replace_svc_domain {
     'MaxWebSize'       => $new->acct_def_file_quota,
     'MaxWebFile'       => $new->acct_def_file_maxnum,
     'MaxFileSize'      => $new->acct_def_file_maxsize,
+    'RulesAllowed'     => $new->acct_def_cgp_rulesallowed,
+    'RPOPAllowed'      => ( $new->acct_def_cgp_rpopallowed    ? 'YES' : 'NO' ),
+    'MailToAll'        => ( $new->acct_def_cgp_mailtoall      ? 'YES' : 'NO' ),
+    'AddMailTrailer'   => ( $new->acct_def_cgp_addmailtrailer ? 'YES' : 'NO' ),
   );
   warn "WARNING: error queueing SetAccountDefaults job: $def_err"
     if $def_err;
@@ -865,6 +877,7 @@ sub communigate_pro_command { #subroutine, not method
   my( $machine, $port, $login, $password, $method, @args ) = @_;
 
   eval "use CGP::CLI";
+  die $@ if $@;
 
   my $cli = new CGP::CLI( {
     'PeerAddr' => $machine,