export host selection per service, RT#17914
[freeside.git] / FS / FS / part_export / acct_plesk.pm
index e295a01..50b6fae 100644 (file)
@@ -15,15 +15,17 @@ tie my %options, 'Tie::IxHash',
 ;
 
 %info = (
-  'svc'    => 'svc_acct',
-  'desc'   => 'Real-time export to Plesk managed mail service',
-  'options'=> \%options,
+  'svc'        => 'svc_acct',
+  'desc'       => 'Real-time export to Plesk managed mail service',
+  'options'    => \%options,
+  'no_machine' => 1,
+  'default_svc_class' => 'Email',
   'notes'  => <<'END'
 Real-time export to
 <a href="http://www.swsoft.com/">Plesk</a> managed server.
 Requires installation of
 <a href="http://search.cpan.org/dist/Net-Plesk">Net::Plesk</a>
-from CPAN.
+from CPAN and proper <a href="http://www.freeside.biz/mediawiki/index.php/Freeside:1.7:Documentation:Administration:acct_plesk.pm">configuration</a>.
 END
 );
 
@@ -46,6 +48,9 @@ sub _export_insert {
 
 sub _plesk_command {
   my( $self, $method, $domain, @args ) = @_;
+
+  eval "use Net::Plesk;";
+  return $@ if $@;
   
   local($Net::Plesk::DEBUG) = 1
     if $self->option('debug');
@@ -57,7 +62,7 @@ sub _plesk_command {
   );
 
   my $dresponse = $plesk->domain_get( $domain );
-  return $dresponse->error unless $dresponse->is_success;
+  return $dresponse->errortext unless $dresponse->is_success;
   my $domainID = $dresponse->id;
 
   my $response = $plesk->$method($dresponse->id, @args);