RT# 83450 - fixed rateplan export
[freeside.git] / FS / FS / part_export / cp.pm
index c4750dd..2ae97e1 100644 (file)
@@ -1,10 +1,33 @@
 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,
+  'default_svc_class' => 'Email',
+  'notes'  => <<'END'
+Real-time export to
+<a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>.
+Requires installation of
+<a href="http://search.cpan.org/dist/Net-APP">Net::APP</a>
+from CPAN.
+END
+);
+
 sub rebless { shift; }
 
 sub _export_insert {
@@ -21,8 +44,9 @@ sub _export_replace {
   my( $self, $new, $old ) = (shift, shift, shift);
   return "can't change domain with Critical Path"
     if $old->domain ne $new->domain;
-  return '' unless $old->username  ne $new->username
-                || $old->_password ne $new->_password;
+  return "can't change username with Critical Path" #CP no longer supports this
+    if $old->username ne $new->username;
+  return '' unless $old->_password ne $new->_password;
   $self->cp_queue( $new->svcnum, 'replace', $new->domain,
     $old->username, $new->username, $old->_password, $new->_password );
 }
@@ -134,3 +158,5 @@ sub cp_command { #subroutine, not method
 
 }
 
+1;
+