X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fcommunigate_pro.pm;h=557aad91dd93ae0cd70ff67fa01f6b4c4070ba9f;hb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;hp=9a4539a4ad04df3ec05615c1199d9e905aa19f69;hpb=069c216ff8e61e002535b099cab0cb67fc1defd9;p=freeside.git diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index 9a4539a4a..557aad91d 100644 --- a/FS/FS/part_export/communigate_pro.pm +++ b/FS/FS/part_export/communigate_pro.pm @@ -8,10 +8,15 @@ use FS::queue; sub rebless { shift; } +sub export_username { + my($self, $svc_acct) = (shift, shift); + $svc_acct->email; +} + sub _export_insert { my( $self, $svc_acct ) = (shift, shift); my @options = ( $svc_acct->svcnum, 'CreateAccount', - 'accountName' => $svc_acct->email, + 'accountName' => $self->export_username($svc_acct), 'accountType' => $self->option('accountType'), 'AccessModes' => $self->option('AccessModes'), 'RealName' => $svc_acct->finger, @@ -26,10 +31,10 @@ sub _export_insert { sub _export_replace { my( $self, $new, $old ) = (shift, shift, shift); - return "can't (yet) change domain with CommuniGate Pro" - if $old->domain ne $new->domain; return "can't (yet) change username with CommuniGate Pro" if $old->username ne $new->username; + return "can't (yet) change domain with CommuniGate Pro" + if $self->export_username($old) ne $self->export_username($new); return "can't (yet) change GECOS with CommuniGate Pro" if $old->finger ne $new->finger; return "can't (yet) change quota with CommuniGate Pro" @@ -47,7 +52,7 @@ sub _export_replace { #my $jobnum = $err_or_queue->jobnum; $self->communigate_pro_queue( $new->svcnum, 'SetAccountPassword', - $new->email, $new->_password ) + $self->export_username($new), $new->_password ) if $new->_password ne $old->_password; } @@ -55,14 +60,14 @@ sub _export_replace { sub _export_delete { my( $self, $svc_acct ) = (shift, shift); $self->communigate_pro_queue( $svc_acct->svcnum, 'DeleteAccount', - $svc_acct->email, + $self->export_username($svc_acct), ); } sub _export_suspend { my( $self, $svc_acct ) = (shift, shift); $self->communigate_pro_queue( $svc_acct->svcnum, 'UpdateAccountSettings', - 'accountName' => $svc_acct->email, + 'accountName' => $self->export_username($svc_acct), 'AccessModes' => 'Mail', ); } @@ -70,7 +75,7 @@ sub _export_suspend { sub _export_unsuspend { my( $self, $svc_acct ) = (shift, shift); $self->communigate_pro_queue( $svc_acct->svcnum, 'UpdateAccountSettings', - 'accountName' => $svc_acct->email, + 'accountName' => $self->export_username($svc_acct), 'AccessModes' => $self->option('AccessModes'), ); }