From: jeff Date: Sat, 18 Nov 2006 02:17:58 +0000 (+0000) Subject: include templating on domain addition and make web hosting optional X-Git-Url: http://git.freeside.biz/gitweb/?p=Net-Plesk.git;a=commitdiff_plain;h=79a393425645b123a1833e5b65dcb1683bbdccf5 include templating on domain addition and make web hosting optional --- diff --git a/lib/Net/Plesk.pm b/lib/Net/Plesk.pm index 3e78963..62a6811 100644 --- a/lib/Net/Plesk.pm +++ b/lib/Net/Plesk.pm @@ -24,9 +24,9 @@ use Net::Plesk::Method::client_ippool_add_ip; @ISA = qw(Exporter); -$VERSION = '0.01'; +$VERSION = '0.02'; -$PROTO_VERSION = '1.4.0.0'; +$PROTO_VERSION = '1.4.1.0'; $DEBUG = 1; diff --git a/lib/Net/Plesk/Method/domain_add.pm b/lib/Net/Plesk/Method/domain_add.pm index cfe55be..0148367 100644 --- a/lib/Net/Plesk/Method/domain_add.pm +++ b/lib/Net/Plesk/Method/domain_add.pm @@ -5,7 +5,7 @@ use strict; use vars qw( $VERSION @ISA $AUTOLOAD $DEBUG ); @ISA = qw( Net::Plesk::Method ); -$VERSION = '0.01'; +$VERSION = '0.02'; $DEBUG = 0; @@ -38,8 +38,8 @@ $ options are required. =cut sub init { - my ($self, $domain, $client, $ip) = @_; - $$self = join ( "\n", ( + my ($self, $domain, $client, $ip, $template, $user, $pass) = @_; + my $xml = join ( "\n", ( '', '', '', @@ -49,13 +49,25 @@ sub init { '', $self->encode($client), '', - '', - $self->encode($ip), - '', - '', - '', - '', - )); + )); + $xml .= 'vrt_hst' if defined($user); + $xml .= join ( "\n", ( '', + $self->encode($ip), + '', + '', + )); + if (defined($user)) { + $xml .= "" . $self->encode($user); + $xml .= "" . $self->encode($pass); + $xml .= "" . $self->encode($ip); + $xml .= ""; + } + if ($template) { + $xml .= "" . $self->encode($template) . ""; + } + $xml .= ''; + + $$self = $xml; } =back