diff options
| author | ivan <ivan> | 2003-11-18 15:05:19 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2003-11-18 15:05:19 +0000 | 
| commit | 0dfb8b6685d4150221e76e175d356e5970498420 (patch) | |
| tree | 52928a9d5cc4e6508575a30d76693d3c3a7912f0 | |
| parent | 9a391bca139023b92e876cef69ebc02cc96323d5 (diff) | |
add communigate_pro_singledomain export
| -rw-r--r-- | FS/FS/part_export.pm | 25 | ||||
| -rw-r--r-- | FS/FS/part_export/communigate_pro.pm | 15 | ||||
| -rw-r--r-- | FS/FS/part_export/communigate_pro_singledomain.pm | 11 | ||||
| -rw-r--r-- | FS/MANIFEST | 1 | 
4 files changed, 47 insertions, 5 deletions
| diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index fbd8da100..1273cb8c9 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -741,6 +741,24 @@ tie my %communigate_pro_options, 'Tie::IxHash',                     },  ; +tie my %communigate_pro_singledomain_options, 'Tie::IxHash', +  'port'     => { label=>'Port number', default=>'106', }, +  'login'    => { label=>'The administrator account name.  The name can contain a domain part.', }, +  'password' => { label=>'The administrator account password.', }, +  'domain'   => { label=>'Domain', }, +  'accountType' => { label=>'Type for newly-created accounts', +                     type=>'select', +                     options=>[qw( MultiMailbox TextMailbox MailDirMailbox )], +                     default=>'MultiMailbox', +                   }, +  'externalFlag' => { label=> 'Create accounts with an external (visible for legacy mailers) INBOX.', +                      type=>'checkbox', +                    }, +  'AccessModes' => { label=>'Access modes', +                     default=>'Mail POP IMAP PWD WebMail WebSite', +                   }, +; +  tie my %bind_options, 'Tie::IxHash',    #'machine'    => { label=>'named machine' },    'named_conf' => { label  => 'named.conf location', @@ -934,6 +952,13 @@ tie my %forward_shellcommands_options, 'Tie::IxHash',        'notes' => 'Real time export to a <a href="http://www.stalker.com/CommuniGatePro/"> mail server.  The <a href="http://www.stalker.com/CGPerl/">CommuniGate Pro Perl Interface</a> must be installed as CGP::CLI.',      }, +    'communigate_pro_singledomain' => { +      'desc' => 'Real-time export to a CommuniGate Pro mail server, one domain only', +      'options' => \%communigate_pro_singledomain_options, +      'nodomain' => 'Y', +      'notes' => 'Real time export to a <a href="http://www.stalker.com/CommuniGatePro/"> mail server.  This is an unusual export to CommuniGate Pro that forces all accounts into a single domain.  As CommuniGate Pro supports multiple domains, unless you have a specific reason for using this export, you probably want to use the communigate_pro export instead.  The <a href="http://www.stalker.com/CGPerl/">CommuniGate Pro Perl Interface</a> must be installed as CGP::CLI.', +    }, +    },    'svc_domain' => { diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index 9a4539a4a..aa038f08e 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, @@ -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'),    );  } diff --git a/FS/FS/part_export/communigate_pro_singledomain.pm b/FS/FS/part_export/communigate_pro_singledomain.pm new file mode 100644 index 000000000..11574af9b --- /dev/null +++ b/FS/FS/part_export/communigate_pro_singledomain.pm @@ -0,0 +1,11 @@ +package FS::part_export::communigate_pro_singledomain; + +use vars qw(@ISA); +use FS::part_export::communigate_pro; + +@ISA = qw(FS::part_export::communigate_pro); + +sub export_username { +  my($self, $svc_acct) = (shift, shift); +  $svc_acct->username. '@'. $self->option('domain'); +} diff --git a/FS/MANIFEST b/FS/MANIFEST index 720909c24..c540e86ae 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -71,6 +71,7 @@ FS/part_export/bind.pm  FS/part_export/bind_slave.pm  FS/part_export/bsdshell.pm  FS/part_export/communigate_pro.pm +FS/part_export/communigate_pro_singledomain.pm  FS/part_export/cp.pm  FS/part_export/cyrus.pm  FS/part_export/domain_shellcommands.pm | 
