X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fwww_plesk.pm;h=a247f054eba67efbe91c232de3318edb365a5d6c;hb=f4daf7e8c831fe126dc3fd1d6d0db5ee3b46d602;hp=a4ebbf5173d207f500e9d5cc485694a7f26c3c41;hpb=70cbe021e8ecc7b77dc3a3c25b778d0f21fca94e;p=freeside.git
diff --git a/FS/FS/part_export/www_plesk.pm b/FS/FS/part_export/www_plesk.pm
index a4ebbf517..a247f054e 100644
--- a/FS/FS/part_export/www_plesk.pm
+++ b/FS/FS/part_export/www_plesk.pm
@@ -10,20 +10,24 @@ tie my %options, 'Tie::IxHash',
'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' },
;
%info = (
- 'svc' => 'svc_www',
- 'desc' => 'Real-time export to Plesk managed hosting service',
- 'options'=> \%options,
- 'notes' => <<'END'
+ 'svc' => 'svc_www',
+ 'desc' => 'Real-time export to Plesk managed hosting service',
+ 'options' => \%options,
+ 'no_machine' => 1,
+ 'notes' => <<'END'
Real-time export to
Plesk managed server.
Requires installation of
Net::Plesk
-from CPAN.
+from CPAN and proper configuration.
END
);
@@ -36,7 +40,7 @@ sub rebless { shift; }
sub _export_insert {
my( $self, $www ) = ( shift, shift );
- eval "use Net::Plesk'";
+ eval "use Net::Plesk;";
return $@ if $@;
my $plesk = new Net::Plesk (
@@ -71,17 +75,29 @@ sub _export_insert {
$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'";
+ eval "use Net::Plesk;";
return $@ if $@;
local($Net::Plesk::DEBUG) = 1