diff options
Diffstat (limited to 'dns_wizard')
-rw-r--r-- | dns_wizard/Bind.pm | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/dns_wizard/Bind.pm b/dns_wizard/Bind.pm index 88ecad9d..07423b53 100644 --- a/dns_wizard/Bind.pm +++ b/dns_wizard/Bind.pm @@ -20,7 +20,7 @@ package MDK::Wizard::Bind; use lib qw(/usr/lib/libDrakX); -use ugtk2; +#use ugtk2; use strict; use common; @@ -64,8 +64,17 @@ my $o = { CLIENTNAME => '', CLIENTIP => '', }, - needed_rpm => [ 'bind' ], - defaultimage => "/usr/share/wizards/dns_wizard/images/DNS.png" +# needed_rpm => [ 'bind' ], + defaultimage => "/usr/share/wizards/dns_wizard/images/DNS.png", + init => sub { + if ($SHORTHOSTNAME =~ /localhost/) { + return (0, N("You need to readjust your hostname.")) + } + if (member($DOMAINNAME, qw(localdomain (none)))) { + return (0, N("You need to readjust your domainname. For a DNS server you need a correct domainname, not egal to localdomain or none. Launch drakconnect to adjust it.")) + } + 1 + }, }; my %level = ( @@ -75,7 +84,6 @@ my %level = ( 4 => N("remove host - Remove a Host in DNS"), ); - my @list_hosts; sub list_hosts { @@ -95,9 +103,6 @@ $o->{pages} = { welcome => { name => N('DNS Master configuration wizard') . "\n\n" . N('DNS (Domain Name Server) is the service that maps an IP address of a machine with an internet host name.') . "\n\n" . N('This wizard will help you configuring the DNS services of your server. This configuration will provide a local DNS service for local computers names, with non-local requests forwarded to an outside DNS.'), no_back => 1, - post => \&check_domain, - post => \&check_hostname, - post => \&check_dhcp, pre => sub { $o->{var}{wiz_level} ||= 1; }, @@ -112,6 +117,7 @@ $o->{pages} = { data => [ { label => N("What do you want todo:"), val => \$o->{var}{wiz_level}, list => [ keys %level ], format => sub { $level{$_[0]} } }, ], + next => 'ipforward', }, addhost => { @@ -139,16 +145,7 @@ $o->{pages} = { post => \&check_ipm, next => 'summaryslave', }, - error_hostname => { - name => N('You need to readjust your hostname.'), - end => 1, - next => 0, - }, - error_domain => { - name => N('You need to readjust your domainame.'), - end => 1, - next => 0, - }, + ipforward => { name => N('IP of your forwarders') . "\n\n" . N('Forwarding occurs on only those queries for which the server is not authoritative and does not have the answer in its cache.') . "\n\n" . N('So if you need it and know your ip forwarder enter IP address of it, if you dont know leave it blank'), data => [ @@ -159,6 +156,7 @@ $o->{pages} = { }, addsearch => { name => N('Add search domain') . "\n\n" . N('Search list for host-name lookup. The search list is normally determined from the local domain name; by default, it contains only the local domain name. This may be changed by listing the desired domain search path following the search keyword') . "\n\n" . N('Domainname of this server is automatically added, and you dont need to add it here.'), + data => [ { label => N('add search domain:'), val => \$o->{var}{ADDSEARCH} }, ], @@ -260,7 +258,6 @@ $o->{pages} = { }, }; - sub check_dhcp { $wiz->{net}->is_dhcp() and return 'dhcp_warning'; } @@ -313,19 +310,6 @@ sub get_spe_ip { } } - -# check that hostnmae is != from localhost -sub check_hostname { - if ($o->{var}{SHORTHOSTNAME} =~ /localhost/) { - return 'error_hostname' } -} - -# check domainame != localdomain -sub check_domain { - if (member($o->{var}{DOMAINNAME}, qw(localdomain (none)))) { - return 'error_domain' } -} - sub crea_db_local { output($WDIR . "/db.localhost", <<EOF); \$TTL 3D |