From c79bb77f86bb67e5a765d667c06e986291d86596 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Wed, 13 Sep 2006 12:32:32 +0000 Subject: fix bug #25508 --- dns_wizard/Bind.pm | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'dns_wizard') diff --git a/dns_wizard/Bind.pm b/dns_wizard/Bind.pm index 0600f326..a736a064 100644 --- a/dns_wizard/Bind.pm +++ b/dns_wizard/Bind.pm @@ -26,10 +26,10 @@ use services; use common; use MDK::Wizard::Varspaceval; use MDK::Wizard::Wizcommon; - +use network::network; my $wiz = new MDK::Wizard::Wizcommon; - +my $in = interactive->vnew; my $SERIAL = chomp_(`date +20%y%m%d`); my $HOSTNAME = $wiz->{net}->network_get("HOSTNAME"); my $BIND_CHROOT = "/var/lib/named"; @@ -132,7 +132,15 @@ $o->{pages} = { { label => N("Name of the machine:"), val => \$o->{var}{CLIENTNAME} }, { label => N("IP address of the machine:"), val => \$o->{var}{CLIENTIP} }, ], - post => \&check_iph, + complete => sub { + if ($o->{var}{CLIENTIP}) { + if (!is_ip($o->{var}{CLIENTIP})) { + #$in->ask_warn(N('Error'), N('This is not a valid IP address.')); + return 1; + } else { return 0; } + } + }, + no_back => 1, next => 'summaryadd', no_back => 1, }, removehost => { @@ -148,7 +156,15 @@ $o->{pages} = { data => [ { label => N("IP Address of the master DNS server:"), val => \$o->{var}{IPMASTER} }, ], - post => \&check_ipm, + complete => sub { + if ($o->{var}{IPMASTER}) { + if (!is_ip($o->{var}{IPMASTER})) { + #$in->ask_warn(N('Error'), N('This is not a valid IP address.')); + return 1; + } else { return 0; } + } + }, + no_back => 1, next => 'summaryslave', }, @@ -161,7 +177,15 @@ $o->{pages} = { data => [ { label => N("External DNS:"), val => \$o->{var}{IPOFFORWARDER} }, ], - post => \&check_ipf, + complete => sub { + if ($o->{var}{IPOFFORWARDER}) { + if (!is_ip($o->{var}{IPOFFORWARDER})) { + #$in->ask_warn(N('Error'), N('This is not a valid IP address for your forwarder.')); + return 1; + } else { return 0; } + } + }, + no_back => 1, next => 'addsearch', }, addsearch => { -- cgit v1.2.1