X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fcp.pm;h=a295c574bad961170841386e3f239e83e80fc1a6;hb=bc10c7592866836b56d12b4e8b18f5fa67785a24;hp=d998c1d95c36210b7983d35fa3bef1d74de83c1f;hpb=9bf26ed4b065b12826fc2980ff277a2f3be25c1d;p=freeside.git
diff --git a/FS/FS/part_export/cp.pm b/FS/FS/part_export/cp.pm
index d998c1d95..a295c574b 100644
--- a/FS/FS/part_export/cp.pm
+++ b/FS/FS/part_export/cp.pm
@@ -1,19 +1,41 @@
package FS::part_export::cp;
-use vars qw(@ISA);
+use vars qw(@ISA %info);
+use Tie::IxHash;
use FS::part_export;
@ISA = qw(FS::part_export);
+tie my %options, 'Tie::IxHash',
+ 'port' => { label=>'Port number' },
+ 'username' => { label=>'Username' },
+ 'password' => { label=>'Password' },
+ 'domain' => { label=>'Domain' },
+ 'workgroup' => { label=>'Default Workgroup' },
+;
+
+%info = (
+ 'svc' => 'svc_acct',
+ 'desc' => 'Real-time export to Critical Path Account Provisioning Protocol',
+ 'options'=> \%options,
+ 'notes' => <<'END'
+Real-time export to
+Critial Path Account Provisioning Protocol.
+Requires installation of
+Net::APP
+from CPAN.
+END
+);
+
sub rebless { shift; }
sub _export_insert {
my( $self, $svc_acct ) = (shift, shift);
$self->cp_queue( $svc_acct->svcnum, 'create_mailbox',
- Mailbox => $svc_acct->username,
- Password => $svc_acct->_password,
- Workgroup => $self->option('workgroup'),
- Domain => $svc_acct->domain,
+ 'Mailbox' => $svc_acct->username,
+ 'Password' => $svc_acct->_password,
+ 'Workgroup' => $self->option('workgroup'),
+ 'Domain' => $svc_acct->domain,
);
}
@@ -30,8 +52,30 @@ sub _export_replace {
sub _export_delete {
my( $self, $svc_acct ) = (shift, shift);
$self->cp_queue( $svc_acct->svcnum, 'delete_mailbox',
- Mailbox => $svc_acct->username,
- Domain => $svc_acct->domain,
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ );
+}
+
+sub _export_suspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'set_mailbox_status',
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ 'OTHER' => 'T',
+ 'OTHER_SUSPEND' => 'T',
+ );
+}
+
+sub _export_unsuspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'set_mailbox_status',
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ 'PAYMENT' => 'F',
+ 'OTHER' => 'F',
+ 'OTHER_SUSPEND' => 'F',
+ 'OTHER_BOUNCE' => 'F',
);
}
@@ -42,7 +86,7 @@ sub cp_queue {
'job' => 'FS::part_export::cp::cp_command',
};
$queue->insert(
- $self->option('host'),
+ $self->machine,
$self->option('port'),
$self->option('username'),
$self->option('password'),
@@ -69,20 +113,22 @@ sub cp_command { #subroutine, not method
);
}
- my $other = 'F';
+ #my $other = 'F';
if ( $new_password =~ /^\*SUSPENDED\* (.*)$/ ) {
$new_password = $1;
- $other = 'T';
+ # $other = 'T';
}
- cp_command($host, $port, $username, $password, 'set_mailbox_status',
- Domain => $domain,
- Mailbox => $new_username,
- Other => $other,
- Other_Bounce => $other,
- );
+ #cp_command($host, $port, $username, $password, $login_domain,
+ # 'set_mailbox_status',
+ # Domain => $domain,
+ # Mailbox => $new_username,
+ # Other => $other,
+ # Other_Bounce => $other,
+ #);
if ( $old_password ne $new_password ) {
- cp_command($host, $port, $username, $password, 'change_mailbox',
+ cp_command($host, $port, $username, $password, $login_domain,
+ 'change_mailbox',
Domain => $domain,
Mailbox => $new_username,
Password => $new_password,
@@ -110,3 +156,5 @@ sub cp_command { #subroutine, not method
}
+1;
+