[freeside-commits] freeside/FS/FS/part_export communigate_pro.pm, 1.24, 1.25
Ivan,,,
ivan at wavetail.420.am
Mon Feb 22 02:35:16 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv26648/FS/FS/part_export
Modified Files:
communigate_pro.pm
Log Message:
communigate: domain account defaults, RT#7083
Index: communigate_pro.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/communigate_pro.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- communigate_pro.pm 22 Feb 2010 07:13:29 -0000 1.24
+++ communigate_pro.pm 22 Feb 2010 10:35:14 -0000 1.25
@@ -159,8 +159,29 @@
}
#account defaults
+ my $def_err = $self->communigate_pro_queue( $svc_domain->svcnum,
+ 'SetAccountDefaults',
+ $svc_domain->domain,
+ 'PWDAllowed' =>($svc_domain->acct_def_password_selfchange ? 'YES':'NO'),
+ 'PasswordRecovery' => ($svc_domain->acct_def_password_recover ? 'YES':'NO'),
+ 'AccessModes' => $svc_domain->acct_def_cgp_accessmodes,
+ 'MaxAccountSize' => $svc_domain->acct_def_quota,
+ 'MaxWebSize' => $svc_domain->acct_def_file_quota,
+ 'MaxWebFile' => $svc_domain->acct_def_file_maxnum,
+ 'MaxFileSize' => $svc_domain->acct_def_file_maxsize,
+ );
+ warn "WARNING: error queueing SetAccountDefaults job: $def_err"
+ if $def_err;
#account defaults prefs
+ my $pref_err = $self->communigate_pro_queue( $svc_domain->svcnum,
+ 'SetAccountDefaultPrefs',
+ $svc_domain->domain,
+ 'DeleteMode' => $svc_domain->acct_def_cgp_deletemode,
+ 'EmptyTrash' => $svc_domain->acct_def_cgp_emptytrash,
+ );
+ warn "WARNING: error queueing SetAccountDefaultPrefs job: $pref_err"
+ if $pref_err;
'';
@@ -303,7 +324,34 @@
return $error if $error;
}
- #other kinds of changes?
+ #below this identical to insert... any value to doing an Update here?
+ #not seeing any big one... i guess it would be nice to avoid the update
+ #when things haven't changed
+
+ #account defaults
+ my $def_err = $self->communigate_pro_queue( $new->svcnum,
+ 'SetAccountDefaults',
+ $new->domain,
+ 'PWDAllowed' => ( $new->acct_def_password_selfchange ? 'YES' : 'NO' ),
+ 'PasswordRecovery' => ( $new->acct_def_password_recover ? 'YES' : 'NO' ),
+ 'AccessModes' => $new->acct_def_cgp_accessmodes,
+ 'MaxAccountSize' => $new->acct_def_quota,
+ 'MaxWebSize' => $new->acct_def_file_quota,
+ 'MaxWebFile' => $new->acct_def_file_maxnum,
+ 'MaxFileSize' => $new->acct_def_file_maxsize,
+ );
+ warn "WARNING: error queueing SetAccountDefaults job: $def_err"
+ if $def_err;
+
+ #account defaults prefs
+ my $pref_err = $self->communigate_pro_queue( $new->svcnum,
+ 'SetAccountDefaultPrefs',
+ $new->domain,
+ 'DeleteMode' => $new->acct_def_cgp_deletemode,
+ 'EmptyTrash' => $new->acct_def_cgp_emptytrash,
+ );
+ warn "WARNING: error queueing SetAccountDefaultPrefs job: $pref_err"
+ if $pref_err;
'';
}
@@ -463,12 +511,30 @@
) };
return $@ if $@;
- #warn Dumper($acct_defaults);
+ my $acct_defaultprefs = eval { $self->communigate_pro_runcommand(
+ 'GetAccountDefaultPrefs',
+ $svc_domain->domain
+ ) };
+ return $@ if $@;
- %$effective_settings = ( %$effective_settings,
- map { ("Acct. Default $_" => $acct_defaults->{$_}); }
- keys(%$acct_defaults)
- );
+ %$effective_settings = (
+ %$effective_settings,
+ ( map { ("Acct. Default $_" => $acct_defaults->{$_}); }
+ keys(%$acct_defaults)
+ ),
+ ( map { ("Acct. Default $_" => $acct_defaultprefs->{$_}); } #diff label??
+ keys(%$acct_defaultprefs)
+ ),
+ );
+ %$settings = (
+ %$settings,
+ ( map { ("Acct. Default $_" => $acct_defaults->{$_}); }
+ keys(%$acct_defaults)
+ ),
+ ( map { ("Acct. Default $_" => $acct_defaultprefs->{$_}); } #diff label??
+ keys(%$acct_defaultprefs)
+ ),
+ );
#aliases too
my $aliases = eval { $self->communigate_pro_runcommand(
@@ -591,13 +657,17 @@
my( $self, $jobnumref, $svcnum, $method ) = splice(@_,0,4);
my %kludge_methods = (
- #'CreateAccount' => 'CreateAccount',
- 'UpdateAccountSettings' => 'UpdateAccountSettings',
- 'UpdateAccountPrefs' => 'cp_Scalar_Hash',
- #'CreateDomain' => 'cp_Scalar_Hash',
- #'CreateSharedDomain' => 'cp_Scalar_Hash',
- 'UpdateDomainSettings' => 'UpdateDomainSettings',
- 'SetDomainAliases' => 'cp_Scalar_Array',
+ #'CreateAccount' => 'CreateAccount',
+ 'UpdateAccountSettings' => 'UpdateAccountSettings',
+ 'UpdateAccountPrefs' => 'cp_Scalar_Hash',
+ #'CreateDomain' => 'cp_Scalar_Hash',
+ #'CreateSharedDomain' => 'cp_Scalar_Hash',
+ 'UpdateDomainSettings' => 'cp_Scalar_settingsHash',
+ 'SetDomainAliases' => 'cp_Scalar_Array',
+ 'SetAccountDefaults' => 'cp_Scalar_settingsHash',
+ 'UpdateAccountDefaults' => 'cp_Scalar_settingsHash',
+ 'SetAccountDefaultPrefs' => 'cp_Scalar_settingsHash',
+ 'UpdateAccountDefaultPrefs' => 'cp_Scalar_settingsHash',
);
my $sub = exists($kludge_methods{$method})
? $kludge_methods{$method}
@@ -655,9 +725,11 @@
# communigate_pro_command( $machine, $port, $login, $password, $method, @args );
#}
-sub UpdateDomainSettings {
+sub cp_Scalar_settingsHash {
my( $machine, $port, $login, $password, $method, $domain, %settings ) = @_;
- $settings{'DomainAccessModes'} = [split(' ',$settings{'DomainAccessModes'})];
+ for (qw( AccessModes DomainAccessModes )) {
+ $settings{$_} = [split(' ',$settings{$_})] if $settings{$_};
+ }
my @args = ( 'domain' => $domain, 'settings' => \%settings );
communigate_pro_command( $machine, $port, $login, $password, $method, @args );
}
More information about the freeside-commits
mailing list