use vars qw( $VERSION @ISA $AUTOLOAD $DEBUG );
@ISA = qw( Net::Plesk::Method );
-$VERSION = '0.01';
+$VERSION = '0.02';
$DEBUG = 0;
=cut
sub init {
- my ($self, $domain, $client, $ip) = @_;
- $$self = join ( "\n", (
+ my ($self, $domain, $client, $ip, $template, $user, $pass) = @_;
+ my $xml = join ( "\n", (
'<domain>',
'<add>',
'<gen_setup>',
'<client_id>',
$self->encode($client),
'</client_id>',
- '<ip_address>',
- $self->encode($ip),
- '</ip_address>',
- '</gen_setup>',
- '</add>',
- '</domain>',
- ));
+ ));
+ $xml .= '<htype>vrt_hst</htype>' if defined($user);
+ $xml .= join ( "\n", ( '<ip_address>',
+ $self->encode($ip),
+ '</ip_address>',
+ '</gen_setup>',
+ ));
+ if (defined($user)) {
+ $xml .= "<hosting><vrt_hst><ftp_login>" . $self->encode($user);
+ $xml .= "</ftp_login><ftp_password>" . $self->encode($pass);
+ $xml .= "</ftp_password><ip_address>" . $self->encode($ip);
+ $xml .= "</ip_address></vrt_hst></hosting>";
+ }
+ if ($template) {
+ $xml .= "<template-name>" . $self->encode($template) . "</template-name>";
+ }
+ $xml .= '</add></domain>';
+
+ $$self = $xml;
}
=back