[freeside-commits] freeside/FS/FS/part_export communigate_pro.pm, 1.16.4.3, 1.16.4.4
Ivan,,,
ivan at wavetail.420.am
Sat Feb 20 23:28:15 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv12247/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.3
retrieving revision 1.16.4.4
diff -u -d -r1.16.4.3 -r1.16.4.4
--- communigate_pro.pm 21 Feb 2010 03:16:04 -0000 1.16.4.3
+++ communigate_pro.pm 21 Feb 2010 07:28:12 -0000 1.16.4.4
@@ -17,7 +17,7 @@
'password' => { label =>'The administrator account password.', },
'accountType' => { label => 'Type for newly-created accounts (default when not specified in service)',
type => 'select',
- options => [qw(MultiMailbox TextMailbox MailDirMailbox)],
+ options => [qw(MultiMailbox TextMailbox MailDirMailbox AGrade BGrade CGrade)],
default => 'MultiMailbox',
},
'externalFlag' => { label => 'Create accounts with an external (visible for legacy mailers) INBOX.',
@@ -70,30 +70,45 @@
sub _export_insert_svc_acct {
my( $self, $svc_acct ) = (shift, shift);
- my @options = ( $svc_acct->svcnum, 'CreateAccount',
- 'accountName' => $self->export_username($svc_acct),
- 'accountType' => ( $svc_acct->cgp_type
- || $self->option('accountType') ),
+ my %settings = (
'AccessModes' => ( $svc_acct->cgp_accessmodes
|| $self->option('AccessModes') ),
'RealName' => $svc_acct->finger,
'Password' => $svc_acct->_password,
+ map { $quotas{$_} => $svc_acct->$_() }
+ grep $svc_acct->$_(), keys %quotas
);
- push @options, $quotas{$_} => $svc_acct->$_()
- foreach grep $svc_acct->$_(), keys %quotas;
+ #XXX preferences phase 1: message delete method, on logout remove trash
+ #phase 2: language, time zone, layout, pronto style, send read receipts
#phase 2: pwdallowed, passwordrecovery, allowed mail rules,
# RPOP modifications, accepts mail to all, add trailer to sent mail
#phase 3: archive messages, mailing lists
+ my @options = ( 'CreateAccount',
+ 'accountName' => $self->export_username($svc_acct),
+ 'accountType' => ( $svc_acct->cgp_type
+ || $self->option('accountType') ),
+ 'settings' => \%settings
+ );
+
push @options, 'externalFlag' => $self->option('externalFlag')
if $self->option('externalFlag');
- #XXX preferences phase 1: message delete method, on logout remove trash
- #phase 2: language, time zone, layout, pronto style, send read receipts
+ #let's do the create realtime too, for much the same reasons, and to avoid
+ #pain of trying to queue w/dep the aliases
+ #my $r=
+ eval { $self->communigate_pro_runcommand( @options ) };
+ return $@ if $@;
- $self->communigate_pro_queue( @options );
+ my $err= $self->communigate_pro_queue( $svc_acct->svcnum, 'SetAccountAliases',
+ $self->export_username($svc_acct),
+ [ split(/\s*,\s*/, $svc_acct->cgp_aliases) ],
+ );
+ warn "WARNING: error queueing SetAccountAliases job: $err" if $err;
+
+ '';
}
@@ -172,6 +187,16 @@
return $error if $error;
}
+ if ( $old->cgp_aliases ne $new->cgp_aliases ) {
+ my $error = $self->communigate_pro_queue(
+ $new->svcnum,
+ 'SetAccountAliases',
+ $self->export_username($new),
+ [ split(/\s*,\s*/, $new->cgp_aliases) ],
+ );
+ return $error if $error;
+ }
+
#XXX preferences phase 1: message delete method, on logout remove trash
#phase 2: language, time zone, layout, pronto style, send read receipts
@@ -395,6 +420,17 @@
keys(%$prefs)
);
+ #aliases too
+
+ my $aliases = eval { $self->communigate_pro_runcommand(
+ 'GetAccountAliases',
+ $svc_acct->email
+ ) };
+ return $@ if $@;
+
+ $effective_settings->{'Aliases'} = join(', ', @$aliases);
+ $settings->{'Aliases'} = join(', ', @$aliases);
+
#false laziness w/above
my %defaults = map { $_ => 1 }
More information about the freeside-commits
mailing list