use vars qw(@ISA %info);
use Tie::IxHash;
use FS::part_export;
-use Net::Plesk;
-use Net::Plesk::Response;
@ISA = qw(FS::part_export);
'URL' => { label=>'URL' },
'login' => { label=>'Login' },
'password' => { label=>'Password' },
+ 'template' => { label=>'Domain Template' },
+ 'web' => { label=>'Host Website',
+ type=>'checkbox' },
'debug' => { label=>'Enable debugging',
type=>'checkbox' },
;
<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:www_plesk.pm">configuration</a>.
END
);
sub _export_insert {
my( $self, $www ) = ( shift, shift );
-
+
+ eval "use Net::Plesk;";
+ return $@ if $@;
+
my $plesk = new Net::Plesk (
'POST' => $self->option('URL'),
':HTTP_AUTH_LOGIN' => $self->option('login'),
$www->domain_record->recdata,
);
- $self->_plesk_command( 'domain_add',
- $www->domain_record->svc_domain->domain,
- $gcresp->id,
- $www->domain_record->recdata,
- );
+ if ($self->option('web')) {
+ $self->_plesk_command( 'domain_add',
+ $www->domain_record->svc_domain->domain,
+ $gcresp->id,
+ $www->domain_record->recdata,
+ $self->option('template')?$self->option('template'):'',
+ $www->svc_acct->username,
+ $www->svc_acct->_password,
+ );
+ }else{
+ $self->_plesk_command( 'domain_add',
+ $www->domain_record->svc_domain->domain,
+ $gcresp->id,
+ $www->domain_record->recdata,
+ $self->option('template')?$self->option('template'):'',
+ );
+ }
}
sub _plesk_command {
my( $self, $method, @args ) = @_;
+
+ eval "use Net::Plesk;";
+ return $@ if $@;
local($Net::Plesk::DEBUG) = 1
if $self->option('debug');