X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fcommunigate_pro.pm;h=ae20e2423c2b67cadd4e0ee7f50ded0ef0ca1a43;hb=f4f77f82129f972d17d95a1e1f7bda9d1f1c4325;hp=bce7f301f8367c7888db6e1821d84d1262d5a9d8;hpb=1db61c35afc546c51de4931ced48330c19af21eb;p=freeside.git diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index bce7f301f..ae20e2423 100644 --- a/FS/FS/part_export/communigate_pro.pm +++ b/FS/FS/part_export/communigate_pro.pm @@ -10,14 +10,18 @@ sub rebless { shift; } sub _export_insert { my( $self, $svc_acct ) = (shift, shift); - $self->communigate_pro_queue( $svc_acct->svcnum, 'CreateAccount', + my @options = ( $svc_acct->svcnum, 'CreateAccount', 'accountName' => $svc_acct->email, 'accountType' => $self->option('accountType'), - 'externalFlag' => $self->option('externalFlag'), 'AccessModes' => $self->option('AccessModes'), 'RealName' => $svc_acct->finger, - 'MaxAccountSize' => $svc_acct->quota, + 'Password' => $svc_acct->_password, ); + push @options, 'MaxAccountSize' => $svc_acct->quota if $svc_acct->quota; + push @options, 'externalFlag' => $self->option('externalFlag') + if $self->option('externalFlag'); + + $self->communigate_pro_queue( @options ); } sub _export_replace { @@ -87,8 +91,12 @@ sub CreateAccount { my $accountType = delete $args{'accountType'}; my $externalFlag = delete $args{'externalFlag'}; $args{'AccessModes'} = [ split(' ', $args{'AccessModes'}) ]; - @args = ( accountName => $accountName, [ settings => \%args ], - accountType => $accountType, externalFlag => $externalFlag, ); + @args = ( accountName => $accountName, + accountType => $accountType, + settings => \%args, + ); + #externalFlag => $externalFlag, + push @args, externalFlag => $externalFlag if $externalFlag; communigate_pro_command( $machine, $port, $login, $password, $method, @args ); @@ -108,6 +116,6 @@ sub communigate_pro_command { #subroutine, not method $cli->$method(@args) or die "CGPro error: ". $cli->getErrMessage; - $cli->Logout or die "Can't logout of CGPro: $CGP:ERR_STRING\n"; + $cli->Logout or die "Can't logout of CGPro: $CGP::ERR_STRING\n"; }