[freeside-commits] freeside/FS/FS/part_export communigate_pro.pm, 1.16.4.2, 1.16.4.3

Ivan,,, ivan at wavetail.420.am
Sat Feb 20 19:16:07 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv18028/FS/FS/part_export

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	communigate_pro.pm 
Log Message:
communigate, RT#7083

Index: communigate_pro.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/communigate_pro.pm,v
retrieving revision 1.16.4.2
retrieving revision 1.16.4.3
diff -u -d -r1.16.4.2 -r1.16.4.3
--- communigate_pro.pm	20 Feb 2010 22:33:10 -0000	1.16.4.2
+++ communigate_pro.pm	21 Feb 2010 03:16:04 -0000	1.16.4.3
@@ -152,10 +152,11 @@
     if $old->finger ne $new->finger;
   $settings{$quotas{$_}} = $new->$_()
     foreach grep $old->$_() ne $new->$_(), keys %quotas;
-  $settings{'AccessModes'} = $new->cgp_accessmodes
-    if $old->cgp_accessmodes ne $new->cgp_accessmodes;
   $settings{'accountType'} = $new->cgp_type
     if $old->cgp_type ne $new->cgp_type;
+  $settings{'AccessModes'} = $new->cgp_accessmodes
+    if $old->cgp_accessmodes ne $new->cgp_accessmodes
+    || $old->cgp_type ne $new->cgp_type;
 
   #phase 2: pwdallowed, passwordrecovery, allowed mail rules,
   # RPOP modifications, accepts mail to all, add trailer to sent mail
@@ -276,7 +277,8 @@
     $svc_acct->svcnum,
     'UpdateAccountSettings',
     $self->export_username($svc_acct),
-    'AccessModes' => $self->option('AccessModes'),
+    'AccessModes' => ( $svc_acct->cgp_accessmodes
+                         || $self->option('AccessModes') ),
   );
 
 }
@@ -338,7 +340,7 @@
   {
     my $value = $effective_settings->{$key};
     if ( ref($value) eq 'ARRAY' ) {
-      $effective_settings->{$key} = join(', ', @$value);
+      $effective_settings->{$key} = join(' ', @$value);
     } else {
       #XXX
       warn "serializing ". ref($value). " for table display not yet handled";
@@ -370,7 +372,28 @@
 
   delete($effective_settings->{'Password'});
 
-  #XXX prefs/effectiveprefs too
+  #prefs/effectiveprefs too
+
+  my $prefs = eval { $self->communigate_pro_runcommand(
+    'GetAccountPrefs',
+    $svc_acct->email
+  ) };
+  return $@ if $@;
+
+  my $effective_prefs = eval { $self->communigate_pro_runcommand(
+    'GetAccountEffectivePrefs',
+    $svc_acct->email
+  ) };
+  return $@ if $@;
+
+  %$effective_settings = ( %$effective_settings,
+                           map { ("Pref $_" => $effective_prefs->{$_}); }
+                               keys(%$effective_prefs)
+                         );
+  %$settings = ( %$settings,
+                 map { ("Pref $_" => $prefs->{$_}); }
+                     keys(%$prefs)
+               );
 
   #false laziness w/above
 
@@ -382,7 +405,7 @@
   {
     my $value = $effective_settings->{$key};
     if ( ref($value) eq 'ARRAY' ) {
-      $effective_settings->{$key} = join(', ', @$value);
+      $effective_settings->{$key} = join(' ', @$value);
     } else {
       #XXX
       warn "serializing ". ref($value). " for table display not yet handled";



More information about the freeside-commits mailing list