mirror of
https://github.com/webmin/webmin.git
synced 2026-05-06 15:20:29 +01:00
Switch all zone links from indexes to zone names https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3579856&group_id=17457
This commit is contained in:
@@ -133,3 +133,5 @@ When a zone is reloaded, it is now frozed first and then thawed afterwards with
|
||||
---- Changes since 1.580 ----
|
||||
The source IP and port for zone transfers can now be specific on the Addresses and Topology page.
|
||||
Added support for zone signing using the DNSSEC-Tools suite, thanks to a patch from Suresh Krishnaswamy.
|
||||
---- Changes since 1.600 ----
|
||||
Changed all links to zones to use the zone name instead of an index, to prevent incorrect modification during concurrent access to the module.
|
||||
|
||||
@@ -899,7 +899,7 @@ sub can_edit_reverse
|
||||
return $access{'reverse'} || &can_edit_zone($_[0]);
|
||||
}
|
||||
|
||||
# record_input(zoneindex, view, type, file, origin, [num], [record],
|
||||
# record_input(zone-name, view, type, file, origin, [num], [record],
|
||||
# [new-name, new-value])
|
||||
# Display a form for editing or creating a DNS record
|
||||
sub record_input
|
||||
@@ -907,7 +907,7 @@ sub record_input
|
||||
local(%rec, @recs, $ttl, $ttlunit);
|
||||
local $type = $_[6] ? $_[6]->{'type'} : $_[2];
|
||||
print &ui_form_start("save_record.cgi");
|
||||
print &ui_hidden("index", $_[0]);
|
||||
print &ui_hidden("zone", $_[0]);
|
||||
print &ui_hidden("view", $_[1]);
|
||||
print &ui_hidden("file", $_[3]);
|
||||
print &ui_hidden("origin", $_[4]);
|
||||
@@ -2308,6 +2308,37 @@ foreach $z (@zones) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
# get_zone_name_or_error(index|name, [viewindex|"any"])
|
||||
# Looks up a zone by name and view, or calls error
|
||||
sub get_zone_name_or_error
|
||||
{
|
||||
local $zone = &get_zone_name(@_);
|
||||
if (!$zone) {
|
||||
my $msg = $_[1] eq 'any' ? 'master_egone' :
|
||||
$_[1] eq '' ? 'master_egone2' : 'master_egone3';
|
||||
&error(&text($msg, @_));
|
||||
}
|
||||
return $zone;
|
||||
}
|
||||
|
||||
# zone_to_config(&zone)
|
||||
# Given a zone name object, return the config file object for the zone. In an
|
||||
# array context, also returns the main config list and parent object
|
||||
sub zone_to_config
|
||||
{
|
||||
my ($zone) = @_;
|
||||
my $parent = &get_config_parent();
|
||||
my $bconf = &get_config();
|
||||
my $conf = $bconf;
|
||||
if ($zone->{'viewindex'} ne '') {
|
||||
my $view = $conf->[$zone->{'viewindex'}];
|
||||
$conf = $view->{'members'};
|
||||
$parent = $view;
|
||||
}
|
||||
my $z = $conf->[$zone->{'index'}];
|
||||
return wantarray ? ( $z, $bconf, $parent ) : $z;
|
||||
}
|
||||
|
||||
# list_slave_servers()
|
||||
# Returns a list of Webmin servers on which slave zones are created / deleted
|
||||
sub list_slave_servers
|
||||
@@ -2838,17 +2869,17 @@ if (-r $signfile) {
|
||||
}
|
||||
}
|
||||
|
||||
# move_zone_button(&config, current-view, zone-index)
|
||||
# move_zone_button(&config, current-view-index, zone-name)
|
||||
# If possible, returns a button row for moving this zone to another view
|
||||
sub move_zone_button
|
||||
{
|
||||
local ($conf, $view, $index) = @_;
|
||||
local ($conf, $view, $zonename) = @_;
|
||||
local @views = grep { &can_edit_view($_) } &find("view", $conf);
|
||||
if ($view eq '' && @views || $view ne '' && @views > 1) {
|
||||
return &ui_buttons_row("move_zone.cgi",
|
||||
$text{'master_move'},
|
||||
$text{'master_movedesc'},
|
||||
&ui_hidden("index", $index).
|
||||
&ui_hidden("zone", $zonename).
|
||||
&ui_hidden("view", $view),
|
||||
&ui_select("newview", undef,
|
||||
[ map { [ $_->{'index'}, $_->{'value'} ] }
|
||||
@@ -2909,7 +2940,7 @@ if (!$access{'ro'} && $access{'apply'}) {
|
||||
# Apply this zone
|
||||
push(@rv, "<a href='restart_zone.cgi?return=$r&".
|
||||
"view=$zone->{'viewindex'}&".
|
||||
"index=$zone->{'index'}'>".
|
||||
"zone=$zone->{'name'}'>".
|
||||
"$text{'links_apply'}</a>");
|
||||
}
|
||||
# Apply whole config
|
||||
|
||||
@@ -12,7 +12,7 @@ elsif ($cgi =~ /^edit_(master|slave|stub|forward|delegation|hint).cgi$/) {
|
||||
# Find a zone of this type
|
||||
my @allzones = grep { &can_edit_zone($_) } &list_zone_names();
|
||||
my ($z) = grep { $_->{'type'} eq $1 } @allzones;
|
||||
return $z ? 'index='.$z->{'index'}.
|
||||
return $z ? 'zone='.$z->{'zone'}.
|
||||
($z->{'view'} ? '&view='.$z->{'viewindex'} : '') : 'none';
|
||||
}
|
||||
elsif ($cgi eq 'edit_view.cgi') {
|
||||
@@ -30,7 +30,7 @@ elsif ($cgi eq 'edit_text.cgi' || $cgi eq 'edit_soa.cgi' ||
|
||||
my ($z) = grep { $_->{'type'} eq 'master' &&
|
||||
&can_edit_zone($_) } &list_zone_names();
|
||||
return 'none' if (!$z);
|
||||
my $rv = 'index='.$z->{'index'}.
|
||||
my $rv = 'zone='.$z->{'zone'}.
|
||||
($z->{'view'} ? '&view='.$z->{'viewindex'} : '');
|
||||
if ($cgi eq 'edit_recs.cgi' || $cgi eq 'edit_record.cgi') {
|
||||
$rv .= '&type=A';
|
||||
@@ -52,7 +52,7 @@ elsif ($cgi eq 'view_text.cgi' || $cgi eq 'edit_soptions.cgi') {
|
||||
# Find a slave zone
|
||||
my ($z) = grep { $_->{'type'} eq 'slave' &&
|
||||
&can_edit_zone($_) } &list_zone_names();
|
||||
return $z ? 'index='.$z->{'index'}.
|
||||
return $z ? 'zone='.$z->{'zone'}.
|
||||
($z->{'view'} ? '&view='.$z->{'viewindex'} : '') : 'none';
|
||||
}
|
||||
return undef;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'apply'} || &error($text{'check_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
|
||||
@@ -27,6 +27,6 @@ else {
|
||||
print "<b>",&text('check_allok', "<tt>$file</tt>"),"</b><p>\n";
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$conf = $conf->[$in{'view'}]->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&error_setup($text{'convert_err'});
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$zconf = &zone_to_config($zone);
|
||||
|
||||
$access{'slave'} || &error($text{'screate_ecannot1'});
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
|
||||
# Change the type directive
|
||||
&save_directive($zconf, 'type', [ { 'name' => 'type',
|
||||
|
||||
@@ -4,14 +4,9 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$conf = $conf->[$in{'view'}]->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&error_setup($text{'convert_err'});
|
||||
$access{'master'} || &error($text{'mcreate_ecannot'});
|
||||
|
||||
$access{'master'} || &error($text{'mcreate_ecannot'});
|
||||
$file = &find("file", $zconf->{'members'});
|
||||
if (!$file) {
|
||||
&error($text{'convert_efile'});
|
||||
|
||||
@@ -62,5 +62,5 @@ $dir = { 'name' => 'zone',
|
||||
$idx = &get_zone_index($in{'zone'}, $in{'view'});
|
||||
|
||||
&add_zone_access($in{'zone'});
|
||||
&redirect("edit_delegation.cgi?index=$idx&view=$in{'view'}");
|
||||
&redirect("edit_delegation.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -73,5 +73,5 @@ $dir = { 'name' => 'zone',
|
||||
$idx = &get_zone_index($in{'zone'}, $in{'view'});
|
||||
|
||||
&add_zone_access($in{'zone'});
|
||||
&redirect("edit_forward.cgi?index=$idx&view=$in{'view'}");
|
||||
&redirect("edit_forward.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -182,6 +182,6 @@ if (&have_dnssec_tools_support() && $in{'enable_dt'}) {
|
||||
&error($err) if ($err);
|
||||
}
|
||||
|
||||
&redirect("edit_master.cgi?index=$idx&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
|
||||
@@ -135,5 +135,5 @@ if ($in{'onslave'} && $access{'remote'}) {
|
||||
}
|
||||
|
||||
&redirect(($in{'type'} ? "edit_slave.cgi" : "edit_stub.cgi").
|
||||
"?index=$idx&view=$in{'view'}");
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
&error_setup($text{'drecs_err'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'recs_ecannot'});
|
||||
@@ -22,14 +22,14 @@ if (!$in{'confirm'} && $config{'confirm_rec'}) {
|
||||
|
||||
print &ui_confirmation_form("delete_recs.cgi",
|
||||
&text('drecs_rusure', scalar(@d), $dom),
|
||||
[ [ 'index', $in{'index'} ],
|
||||
[ [ 'zone', $in{'zone'} ],
|
||||
[ 'view', $in{'view'} ],
|
||||
[ 'rev', $in{'rev'} ],
|
||||
map { [ 'd', $_ ] } @d ],
|
||||
[ [ 'confirm', $text{'drecs_ok'} ] ],
|
||||
);
|
||||
|
||||
&ui_print_footer("edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=$in{'sort'}", $text{'recs_return'});
|
||||
&ui_print_footer("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=$in{'sort'}", $text{'recs_return'});
|
||||
}
|
||||
else {
|
||||
# Delete them
|
||||
@@ -75,7 +75,7 @@ else {
|
||||
&unlock_all_files();
|
||||
|
||||
&webmin_log("delete", "recs", scalar(@d));
|
||||
&redirect("edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=$in{'sort'}");
|
||||
&redirect("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=$in{'sort'}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,24 +4,17 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
$parent = &get_config_parent();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
$viewname = $view->{'values'}->[0];
|
||||
$parent = $view;
|
||||
}
|
||||
else {
|
||||
$viewname = undef;
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
($zconf, $conf, $parent) = &zone_to_config($zone);
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
&error($text{'master_edelete'});
|
||||
|
||||
$access{'ro'} && &error($text{'master_ero'});
|
||||
$access{'delete'} || &error($text{'master_edeletecannot'});
|
||||
|
||||
$rev = ($zconf->{'value'} =~ /in-addr\.arpa/i || $zconf->{'value'} =~ /\.$ipv6revzone/i);
|
||||
$rev = ($zconf->{'value'} =~ /in-addr\.arpa/i ||
|
||||
$zconf->{'value'} =~ /\.$ipv6revzone/i);
|
||||
$type = &find("type", $zconf->{'members'})->{'value'};
|
||||
if (!$in{'confirm'} && $config{'confirm_zone'}) {
|
||||
# Ask the user if he is sure ..
|
||||
@@ -42,7 +35,7 @@ if (!$in{'confirm'} && $config{'confirm_zone'}) {
|
||||
$type eq 'hint' ? $text{'delete_mesg2'} :
|
||||
$type eq 'master' ? &text('delete_mesg', $zdesc) :
|
||||
&text('delete_mesg3', $zdesc),
|
||||
[ [ 'index', $in{'index'} ],
|
||||
[ [ 'zone', $in{'zone'} ],
|
||||
[ 'view', $in{'view'} ] ],
|
||||
[ [ 'confirm', $text{'master_del'} ] ],
|
||||
($type eq 'master' ?
|
||||
@@ -142,7 +135,7 @@ foreach $u (keys %wusers) {
|
||||
# Also delete from slave servers
|
||||
delete($ENV{'HTTP_REFERER'});
|
||||
if ($in{'onslave'} && $access{'remote'}) {
|
||||
@slaveerrs = &delete_on_slaves($zconf->{'value'}, undef, $viewname);
|
||||
@slaveerrs = &delete_on_slaves($zone->{'name'}, undef, $zone->{'view'});
|
||||
if (@slaveerrs) {
|
||||
&error(&text('delete_errslave',
|
||||
"<p>".join("<br>", map { "$_->[0]->{'host'} : $_->[1]" }
|
||||
|
||||
@@ -9,7 +9,7 @@ local $desc;
|
||||
|
||||
&error_setup($text{'dt_zone_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_on_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -27,6 +27,6 @@ if (&have_dnssec_tools_support()) {
|
||||
&webmin_log("zonekeyoff", undef, $dom);
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&error_setup($text{'zonekey_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -25,5 +25,5 @@ foreach my $k (@keyfiles) {
|
||||
&unlock_file(&make_chroot(&absolute_path($zone->{'file'})));
|
||||
|
||||
&webmin_log("zonekeyoff", undef, $dom);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,18 +4,15 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
if ($in{'zone'}) {
|
||||
$zone = &get_zone_name($in{'zone'}, $in{'view'} || 'any');
|
||||
$in{'index'} = $zone->{'index'};
|
||||
$in{'view'} = $zone->{'viewindex'};
|
||||
}
|
||||
else {
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
}
|
||||
$dom = $zone->{'name'};
|
||||
|
||||
&can_edit_zone($zone, $view) ||
|
||||
&error($text{'delegation_ecannot'});
|
||||
$in{'view'} = 'any' if (!defined($in{'view'}));
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
&ui_print_header($desc, $text{'delegation_title'}, "",
|
||||
undef, undef, undef, undef, &restart_links());
|
||||
@@ -27,13 +24,13 @@ if (!$access{'ro'}) {
|
||||
print &ui_buttons_start();
|
||||
|
||||
# Move to another view
|
||||
print &move_zone_button($bconf, $in{'view'}, $in{'index'});
|
||||
print &move_zone_button($bconf, $zone->{'viewindex'}, $in{'zone'});
|
||||
|
||||
# Delete zone
|
||||
if ($access{'delete'}) {
|
||||
print &ui_buttons_row("delete_zone.cgi",
|
||||
$text{'master_del'}, $text{'delegation_delmsg'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
}
|
||||
|
||||
|
||||
@@ -5,21 +5,14 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
|
||||
if ($in{'zone'}) {
|
||||
$zone = &get_zone_name($in{'zone'}, $in{'view'} || 'any');
|
||||
$in{'index'} = $zone->{'index'};
|
||||
$in{'view'} = $zone->{'viewindex'};
|
||||
}
|
||||
else {
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
}
|
||||
$in{'view'} = 'any' if (!defined($in{'view'}));
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
$bconf = $conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}]->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone, $view) ||
|
||||
&error($text{'fwd_ecannot'});
|
||||
@@ -29,7 +22,7 @@ $desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
|
||||
# Start of the form
|
||||
print &ui_form_start("save_forward.cgi");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_start($text{'fwd_opts'}, "width=100%", 4);
|
||||
|
||||
@@ -55,13 +48,13 @@ else {
|
||||
print &ui_buttons_start();
|
||||
|
||||
# Move to another view
|
||||
print &move_zone_button($bconf, $in{'view'}, $in{'index'});
|
||||
print &move_zone_button($bconf, $zone->{'viewindex'}, $in{'zone'});
|
||||
|
||||
# Delete zone
|
||||
if ($access{'delete'}) {
|
||||
print &ui_buttons_row("delete_zone.cgi",
|
||||
$text{'master_del'}, $text{'fwd_delmsg'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'hint_ecannot'});
|
||||
@@ -20,7 +20,7 @@ print &ui_buttons_start();
|
||||
print &ui_buttons_row("refetch.cgi",
|
||||
$text{'hint_refetch'},
|
||||
$text{'hint_refetchdesc'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
|
||||
# Delete button
|
||||
@@ -28,7 +28,7 @@ print &ui_buttons_row(
|
||||
"delete_zone.cgi",
|
||||
$text{'hint_delete'},
|
||||
$text{'hint_deletedesc'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
|
||||
print &ui_buttons_end();
|
||||
|
||||
@@ -4,14 +4,8 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
if ($in{'zone'}) {
|
||||
$zone = &get_zone_name($in{'zone'}, $in{'view'} || 'any');
|
||||
$in{'index'} = $zone->{'index'};
|
||||
$in{'view'} = $zone->{'viewindex'};
|
||||
}
|
||||
else {
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
}
|
||||
$in{'view'} = 'any' if (!defined($in{'view'}));
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
@@ -57,7 +51,7 @@ if ($config{'show_list'}) {
|
||||
else {
|
||||
# display as icons
|
||||
for($i=0; $i<@rcodes; $i++) {
|
||||
push(@rlinks, "edit_recs.cgi?index=$in{'index'}&".
|
||||
push(@rlinks, "edit_recs.cgi?zone=$in{'zone'}&".
|
||||
"view=$in{'view'}&type=$rcodes[$i]");
|
||||
push(@rtitles, ($text{"type_$rcodes[$i]"} || $rcodes[$i]).
|
||||
(defined(%rnum) ? " ($rnum{$rcodes[$i]})" : ""));
|
||||
@@ -70,51 +64,51 @@ else {
|
||||
# links to forms editing text, soa and zone options
|
||||
if ($access{'file'}) {
|
||||
# Manually edit zone
|
||||
push(@links, "edit_text.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_text.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_manual'});
|
||||
push(@images, "images/text.gif");
|
||||
}
|
||||
if ($access{'params'}) {
|
||||
# SOA values
|
||||
push(@links, "edit_soa.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_soa.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_soa'});
|
||||
push(@images, "images/soa.gif");
|
||||
}
|
||||
if ($access{'opts'}) {
|
||||
# Zone options in named.conf
|
||||
push(@links, "edit_options.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_options.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_options'});
|
||||
push(@images, "images/options.gif");
|
||||
}
|
||||
if ($access{'findfree'}) {
|
||||
# Find free IPs
|
||||
push(@links, "find_free.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "find_free.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'findfree_desc'});
|
||||
push(@images, "images/findfree.gif");
|
||||
}
|
||||
if ($access{'gen'}) {
|
||||
# Generators
|
||||
push(@links, "list_gen.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "list_gen.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'gen_title'});
|
||||
push(@images, "images/gen.gif");
|
||||
}
|
||||
if ($access{'whois'} && &has_command($config{'whois_cmd'}) &&
|
||||
$dom !~ /in-addr\.arpa/i) {
|
||||
# Whois lookup
|
||||
push(@links, "whois.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "whois.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_whois'});
|
||||
push(@images, "images/whois.gif");
|
||||
}
|
||||
if ($access{'dnssec'} && &supports_dnssec()) {
|
||||
if (&have_dnssec_tools_support()) {
|
||||
# DNSSEC Automation
|
||||
push(@links, "edit_zonedt.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_zonedt.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'dt_enable_title'});
|
||||
push(@images, "images/dnssectools.gif");
|
||||
}
|
||||
|
||||
# Zone key
|
||||
push(@links, "edit_zonekey.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_zonekey.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'zonekey_title'});
|
||||
push(@images, "images/zonekey.gif");
|
||||
}
|
||||
@@ -134,7 +128,7 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
print &ui_buttons_row(
|
||||
"freeze_zone.cgi", $text{'master_freeze'},
|
||||
$text{'master_freezemsg2'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'})
|
||||
);
|
||||
|
||||
@@ -142,7 +136,7 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
print &ui_buttons_row(
|
||||
"unfreeze_zone.cgi", $text{'master_unfreeze'},
|
||||
$text{'master_unfreezemsg2'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'})
|
||||
);
|
||||
}
|
||||
@@ -152,21 +146,21 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
print &ui_buttons_row(
|
||||
"check_zone.cgi", $text{'master_checkzone'},
|
||||
$text{'master_checkzonemsg'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'})
|
||||
);
|
||||
}
|
||||
|
||||
# Move zone button
|
||||
$conf = &get_config();
|
||||
print &move_zone_button($conf, $in{'view'}, $in{'index'});
|
||||
print &move_zone_button($conf, $zone->{'viewindex'}, $in{'zone'});
|
||||
|
||||
# Convert to slave zone
|
||||
if ($access{'slave'}) {
|
||||
print &ui_buttons_row("convert_master.cgi",
|
||||
$text{'master_convert'},
|
||||
$text{'master_convertdesc'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
}
|
||||
|
||||
@@ -178,7 +172,7 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
($dom !~ /in-addr\.arpa/i &&
|
||||
$dom !~ /\.$ipv6revzone/i ? $text{'master_delrev'}
|
||||
: ""),
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'})
|
||||
);
|
||||
}
|
||||
@@ -198,7 +192,7 @@ if ($_[0]) {
|
||||
], 100);
|
||||
for(my $i=0; $_[$i]; $i++) {
|
||||
local @cols = ( "<a href=\"edit_recs.cgi?".
|
||||
"index=$in{'index'}&view=$in{'view'}&type=$_[$i]\">".
|
||||
"zone=$in{'zone'}&view=$in{'view'}&type=$_[$i]\">".
|
||||
($text{"recs_$_[$i]"} || $_[$i])."</a>" );
|
||||
if (defined(%rnum)) {
|
||||
push(@cols, $rnum{$_[$i]});
|
||||
|
||||
@@ -4,16 +4,14 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$bconf = $conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}]->{'members'};
|
||||
$dom = $conf->[$in{'index'}]->{'value'};
|
||||
&can_edit_zone($conf->[$in{'index'}], $view) ||
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
$access{'opts'} || &error($text{'master_eoptscannot'});
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
&ui_print_header($desc, $text{'master_opts'}, "",
|
||||
@@ -21,7 +19,7 @@ $desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
|
||||
# Start of form for editing zone options
|
||||
print &ui_form_start("save_master.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_start($text{'master_opts'}, "width=100%", 4);
|
||||
|
||||
@@ -41,6 +39,6 @@ print &address_input($text{'master_notify2'}, "also-notify", $zconf);
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'recs_ecannot'});
|
||||
@@ -20,11 +20,11 @@ $desc = &text('edit_header', &ip6int_to_net(&arpa_to_ip($dom)));
|
||||
&ui_print_header($desc, &text('edit_title', $text{"edit_".$rec->{'type'}} || $rec->{'type'}), "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
|
||||
&record_input($in{'index'}, $in{'view'}, $in{'type'}, $file,
|
||||
&record_input($in{'zone'}, $in{'view'}, $in{'type'}, $file,
|
||||
$dom, $in{'num'}, $rec);
|
||||
&ui_print_footer("", $text{'index_return'},
|
||||
"edit_$type.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
"edit_$type.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'recs_return'},
|
||||
"edit_recs.cgi?index=$in{'index'}&type=$in{'type'}",
|
||||
"edit_recs.cgi?zone=$in{'zone'}&type=$in{'type'}",
|
||||
$text{'edit_return'});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'recs_ecannot'});
|
||||
@@ -20,7 +20,7 @@ $type = $zone->{'type'};
|
||||
$file = $zone->{'file'};
|
||||
$form = 0;
|
||||
if (!$access{'ro'} && $type eq 'master' && $in{'type'} ne 'ALL') {
|
||||
&record_input($in{'index'}, $in{'view'}, $in{'type'}, $file, $dom,
|
||||
&record_input($in{'zone'}, $in{'view'}, $in{'type'}, $file, $dom,
|
||||
undef, undef, $in{'newname'}, $in{'newvalue'});
|
||||
$form++;
|
||||
$shown_create_form = 1;
|
||||
@@ -29,7 +29,7 @@ if (!$access{'ro'} && $type eq 'master' && $in{'type'} ne 'ALL') {
|
||||
if ($config{'largezones'}) {
|
||||
# Show search form
|
||||
print &ui_form_start("edit_recs.cgi");
|
||||
print &ui_hidden("index", $in{'index'}),"\n";
|
||||
print &ui_hidden("zone", $in{'zone'}),"\n";
|
||||
print &ui_hidden("view", $in{'view'}),"\n";
|
||||
print &ui_hidden("type", $in{'type'}),"\n";
|
||||
print "<b>$text{'recs_find'}</b>\n";
|
||||
@@ -82,7 +82,7 @@ if (@recs) {
|
||||
@links = ( );
|
||||
if (!$access{'ro'} && $type eq 'master') {
|
||||
print &ui_form_start("delete_recs.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'}),"\n";
|
||||
print &ui_hidden("zone", $in{'zone'}),"\n";
|
||||
print &ui_hidden("view", $in{'view'}),"\n";
|
||||
print &ui_hidden("type", $in{'type'}),"\n";
|
||||
print &ui_hidden("sort", $in{'sort'}),"\n";
|
||||
@@ -122,7 +122,7 @@ elsif (!$shown_create_form) {
|
||||
}
|
||||
|
||||
&ui_print_footer("", $text{'index_return'},
|
||||
"edit_$type.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
"edit_$type.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'recs_return'});
|
||||
|
||||
sub recs_table
|
||||
@@ -136,18 +136,18 @@ if (!$access{'ro'} && $type eq 'master') {
|
||||
push(@hcols, "");
|
||||
push(@tds, "width=5");
|
||||
}
|
||||
push(@hcols, "<a href='edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=1'>".($in{'type'} eq "PTR" ? $text{'recs_addr'} : $text{'recs_name'})."</a>");
|
||||
push(@hcols, "<a href='edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=5'>$text{'recs_type'}</a>") if ($in{'type'} eq "ALL");
|
||||
push(@hcols, "<a href='edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=1'>".($in{'type'} eq "PTR" ? $text{'recs_addr'} : $text{'recs_name'})."</a>");
|
||||
push(@hcols, "<a href='edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=5'>$text{'recs_type'}</a>") if ($in{'type'} eq "ALL");
|
||||
push(@hcols, $text{'recs_ttl'});
|
||||
@hmap = @{$hmap{$in{'type'}}};
|
||||
foreach $h (@hmap) {
|
||||
push(@hcols, "<a href='edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=2'>$h</a>");
|
||||
push(@hcols, "<a href='edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=2'>$h</a>");
|
||||
}
|
||||
if ($in{'type'} eq "ALL" || $is_extra{$in{'type'}}) {
|
||||
push(@hcols, $text{'recs_vals'});
|
||||
}
|
||||
if ($config{'allow_comments'} && $in{'type'} ne "WKS") {
|
||||
push(@hcols, "<a href='edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'type'}&sort=4'>$text{'recs_comment'}</a>");
|
||||
push(@hcols, "<a href='edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=4'>$text{'recs_comment'}</a>");
|
||||
}
|
||||
$rv .= &ui_columns_start(\@hcols, 100);
|
||||
|
||||
@@ -170,8 +170,8 @@ for($i=0; $i<@_; $i++) {
|
||||
$id = &record_id($r);
|
||||
if (!$access{'ro'} && $type eq 'master') {
|
||||
push(@cols,
|
||||
"<a href=\"edit_record.cgi?index=".
|
||||
"$in{'index'}&id=".&urlize($id)."&num=$r->{'num'}&".
|
||||
"<a href=\"edit_record.cgi?zone=".
|
||||
"$in{'zone'}&id=".&urlize($id)."&num=$r->{'num'}&".
|
||||
"type=$in{'type'}&sort=$in{'sort'}&view=$in{'view'}\">".
|
||||
"$name</a>");
|
||||
}
|
||||
|
||||
@@ -4,17 +4,11 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
if ($in{'zone'}) {
|
||||
$zone = &get_zone_name($in{'zone'}, 'any');
|
||||
$in{'index'} = $zone->{'index'};
|
||||
$in{'view'} = $zone->{'viewindex'};
|
||||
}
|
||||
else {
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
}
|
||||
|
||||
$in{'view'} = 'any' if (!defined($in{'view'}));
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'slave_ecannot'});
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
if ($zone->{'file'}) {
|
||||
@@ -53,7 +47,7 @@ if ($zone->{'file'}) {
|
||||
else {
|
||||
# display as icons
|
||||
for($i=0; $i<@rcodes; $i++) {
|
||||
push(@rlinks, "edit_recs.cgi?index=$in{'index'}".
|
||||
push(@rlinks, "edit_recs.cgi?zone=$in{'zone'}".
|
||||
"&view=$in{'view'}&type=$rcodes[$i]");
|
||||
push(@rtitles, $text{"type_$rcodes[$i]"}.
|
||||
" ($rnum{$rcodes[$i]})");
|
||||
@@ -66,22 +60,22 @@ if ($zone->{'file'}) {
|
||||
|
||||
# Shut buttons for editing, options and whois
|
||||
if ($access{'file'} && $zone->{'file'}) {
|
||||
push(@links, "view_text.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "view_text.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'slave_manual'});
|
||||
push(@images, "images/text.gif");
|
||||
}
|
||||
if ($access{'opts'}) {
|
||||
push(@links, "edit_soptions.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "edit_soptions.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_options'});
|
||||
push(@images, "images/options.gif");
|
||||
}
|
||||
if ($access{'whois'} && &has_command($config{'whois_cmd'}) &&
|
||||
$dom !~ /in-addr\.arpa/i) {
|
||||
push(@links, "whois.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "whois.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'master_whois'});
|
||||
push(@images, "images/whois.gif");
|
||||
}
|
||||
push(@links, "xfer.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
push(@links, "xfer.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
push(@titles, $text{'slave_xfer'});
|
||||
push(@images, "images/xfer.gif");
|
||||
if (@links) {
|
||||
@@ -96,14 +90,14 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
|
||||
# Move to other view
|
||||
$conf = &get_config();
|
||||
print &move_zone_button($conf, $in{'view'}, $in{'index'});
|
||||
print &move_zone_button($conf, $zone->{'viewindex'}, $in{'zone'});
|
||||
|
||||
# Convert to master zone
|
||||
if ($access{'master'} && $st[7]) {
|
||||
print &ui_buttons_row("convert_slave.cgi",
|
||||
$text{'slave_convert'},
|
||||
$text{'slave_convertdesc'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
}
|
||||
|
||||
@@ -111,7 +105,7 @@ if (!$access{'ro'} && ($access{'delete'} || $apply)) {
|
||||
if ($access{'delete'}) {
|
||||
print &ui_buttons_row("delete_zone.cgi",
|
||||
$text{'master_del'}, $text{'slave_delmsg'},
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("view", $in{'view'}));
|
||||
}
|
||||
|
||||
@@ -130,7 +124,7 @@ if ($_[0]) {
|
||||
], 100);
|
||||
for(my $i=0; $_[$i]; $i++) {
|
||||
local @cols = ( "<a href=\"edit_recs.cgi?".
|
||||
"index=$in{'index'}&view=$in{'view'}&type=$_[$i]\">".
|
||||
"zone=$in{'zone'}&view=$in{'view'}&type=$_[$i]\">".
|
||||
($text{"recs_$_[$i]"} || $_[$i])."</a>",
|
||||
$rnum{$_[$i]} );
|
||||
$rv .= &ui_columns_row(\@cols);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -24,7 +24,7 @@ $v = $soa->{'values'};
|
||||
print &ui_form_start("save_soa.cgi", "post");
|
||||
print &ui_hidden("num", $soa->{'num'});
|
||||
print &ui_hidden("origin", $dom);
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_start($text{'master_params'}, "width=100%", 4);
|
||||
|
||||
@@ -76,6 +76,6 @@ if (!$config{'updserial_on'}) {
|
||||
print &ui_table_end();
|
||||
print &ui_form_end($access{'ro'} ? [ ] : [ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,17 +4,14 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$bconf = $conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}]->{'members'};
|
||||
$file = &find_value("file", $zconf);
|
||||
$dom = $conf->[$in{'index'}]->{'value'};
|
||||
&can_edit_zone($conf->[$in{'index'}], $view) ||
|
||||
&error($text{'slave_ecannot'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
$access{'opts'} || &error($text{'slave_ecannot'});
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
&ui_print_header($desc, $text{'master_opts'}, "",
|
||||
@@ -22,10 +19,10 @@ $desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
|
||||
# Start of the form
|
||||
print &ui_form_start("save_slave.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_hidden("slave_stub", $scriptname);
|
||||
print &ui_table_start($text{'slave_opts'}, "width=100%", 4);
|
||||
print &ui_table_start($text{'slave_opts'}, "width=100%", 2);
|
||||
|
||||
# Master addresses and port
|
||||
print &address_port_input($text{'slave_masters'},
|
||||
@@ -60,6 +57,6 @@ print &address_input($text{'slave_notify2'}, "also-notify", $zconf);
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer("edit_slave.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_slave.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$file = &absolute_path($zone->{'file'});
|
||||
$tv = $zone->{'type'};
|
||||
&can_edit_zone($zone) ||
|
||||
@@ -20,7 +20,7 @@ if (!$access{'ro'}) {
|
||||
|
||||
print &ui_form_start("save_text.cgi", "form-data");
|
||||
print &ui_table_start(undef, "width=100%", 2);
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_row(undef, &ui_textarea("text", $text, 20, 80,
|
||||
undef, 0, "style='width:100%'"), 2);
|
||||
@@ -30,4 +30,4 @@ print &ui_form_end($access{'ro'} ? [ ] : [ [ undef, $text{'save'} ] ]);
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}", $text{'master_return'});
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
|
||||
@@ -9,7 +9,7 @@ local $desc;
|
||||
local $rrr;
|
||||
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_on_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -80,7 +80,7 @@ if (&have_dnssec_tools_support()) {
|
||||
$text{'dt_zone_rollerdrst'},
|
||||
$text{'dt_zone_rollerdrstdesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("optype", "rollerdrst"));
|
||||
print &ui_buttons_end();
|
||||
print "<br>\n<br>\n";
|
||||
@@ -94,13 +94,13 @@ if (&have_dnssec_tools_support()) {
|
||||
$text{'dt_zone_zskroll'},
|
||||
$text{'dt_zone_zskrolldesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("optype", "zskroll"));
|
||||
print &ui_buttons_row("zone_dnssecmgt_dt.cgi",
|
||||
$text{'dt_zone_kskroll'},
|
||||
$text{'dt_zone_kskrolldesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("optype", "kskroll"));
|
||||
print &ui_buttons_end();
|
||||
print "<br>\n<br>\n";
|
||||
@@ -114,7 +114,7 @@ if (&have_dnssec_tools_support()) {
|
||||
$text{'dt_zone_ksknotify'},
|
||||
$text{'dt_zone_ksknotifydesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("optype", "notify"));
|
||||
print &ui_buttons_end();
|
||||
print "<br>\n<br>\n";
|
||||
@@ -146,7 +146,7 @@ if (&have_dnssec_tools_support()) {
|
||||
$text{'dt_zone_resign'},
|
||||
$text{'dt_zone_resigndesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}).
|
||||
&ui_hidden("zone", $in{'zone'}).
|
||||
&ui_hidden("optype", "resign"));
|
||||
print &ui_buttons_end();
|
||||
print "<br>\n<br>\n";
|
||||
@@ -158,7 +158,7 @@ if (&have_dnssec_tools_support()) {
|
||||
print &ui_buttons_row("disable_zonedt.cgi", $text{'dt_zone_disable'},
|
||||
$text{'dt_zone_disabledesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
print &ui_buttons_end();
|
||||
print "<br>\n<br>\n";
|
||||
print "<br>\n<br>\n";
|
||||
@@ -180,13 +180,13 @@ if (&have_dnssec_tools_support()) {
|
||||
print &ui_buttons_row("zone_dnssecmigrate_dt.cgi", $text{'dt_zone_migrate'},
|
||||
$text{'dt_zone_migratedesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
|
||||
# Offer to remove existing keys
|
||||
print &ui_buttons_row("disable_zonekey.cgi", $text{'zonekey_disable'},
|
||||
$text{'zonekey_disabledesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
|
||||
print &ui_buttons_end();
|
||||
|
||||
@@ -197,7 +197,7 @@ if (&have_dnssec_tools_support()) {
|
||||
print $text{'dt_zone_desc'},"<p>\n";
|
||||
|
||||
print &ui_form_start("enable_zonedt.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
|
||||
print &ui_table_start($text{'dt_zone_header'}, undef, 2);
|
||||
@@ -215,5 +215,5 @@ if (&have_dnssec_tools_support()) {
|
||||
&unlock_file($rrfile);
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -49,13 +49,13 @@ if ($keyrec) {
|
||||
print &ui_buttons_row("disable_zonekey.cgi", $text{'zonekey_disable'},
|
||||
$text{'zonekey_disabledesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
|
||||
# Offer to sign now
|
||||
print &ui_buttons_row("sign_zone.cgi", $text{'zonekey_sign'},
|
||||
$text{'zonekey_signdesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
|
||||
# Offer to re-generate now, for zones with a KSK
|
||||
if (@keys == 2) {
|
||||
@@ -63,7 +63,7 @@ if ($keyrec) {
|
||||
$text{'zonekey_resign'},
|
||||
$text{'zonekey_resigndesc'},
|
||||
&ui_hidden("view", $in{'view'}).
|
||||
&ui_hidden("index", $in{'index'}));
|
||||
&ui_hidden("zone", $in{'zone'}));
|
||||
}
|
||||
|
||||
print &ui_buttons_end();
|
||||
@@ -73,7 +73,7 @@ else {
|
||||
print $text{'zonekey_desc'},"<p>\n";
|
||||
|
||||
print &ui_form_start("enable_zonekey.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_start($text{'zonekey_header'}, undef, 2);
|
||||
|
||||
@@ -98,5 +98,5 @@ else {
|
||||
print &ui_form_end([ [ undef, $text{'zonekey_enable'} ] ]);
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -9,7 +9,7 @@ local $desc;
|
||||
|
||||
&error_setup($text{'dt_zone_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_on_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -40,6 +40,6 @@ if (&have_dnssec_tools_support()) {
|
||||
&webmin_log("zonekeyon", undef, $dom);
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&error_setup($text{'zonekey_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -41,6 +41,6 @@ else {
|
||||
|
||||
&unlock_file(&make_chroot(&absolute_path($zone->{'file'})));
|
||||
&webmin_log("zonekeyon", undef, $dom);
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -5,21 +5,18 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$conf = $conf->[$in{'view'}]->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}]->{'members'};
|
||||
$type = &find("type", $zconf)->{'value'};
|
||||
$file = &find("file", $zconf)->{'value'};
|
||||
$dom = $conf->[$in{'index'}]->{'value'};
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
$file = $zone->{'file'};
|
||||
$type = $zone->{'type'};
|
||||
|
||||
if (!$access{'findfree'}) {&error($text{'findfree_nofind'})};
|
||||
$desc = &text('findfree_header', &arpa_to_ip($dom));
|
||||
&ui_print_header($desc, &text('findfree_title'), "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
|
||||
&find_ips($in{'index'}, $in{'from'}, $in{'to'}, $in{'cf'});
|
||||
&find_ips($in{'zone'}, $in{'from'}, $in{'to'}, $in{'cf'});
|
||||
|
||||
if ($in{'from'} && $in{'to'}) {
|
||||
# Do the search
|
||||
@@ -75,7 +72,7 @@ if ($in{'from'} && $in{'to'}) {
|
||||
} # if(@recs)
|
||||
} # if(@in >= 3)
|
||||
|
||||
&ui_print_footer("edit_$type.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_$type.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'recs_return'});
|
||||
|
||||
# build_iprange(fromIP, toIP)
|
||||
@@ -121,12 +118,12 @@ for ($byte0=$from[0]; $byte0<=$to[0]; $byte0++) {
|
||||
return %frecs;
|
||||
} # sub build_iprange
|
||||
|
||||
# find_ips (zoneindex, from_ip, to_ip, consider_freeXX_names)
|
||||
# find_ips (zonename, from_ip, to_ip, consider_freeXX_names)
|
||||
# Display a form for searching for free IP nos
|
||||
sub find_ips
|
||||
{
|
||||
print &ui_form_start("find_free.cgi");
|
||||
print &ui_hidden("index", $_[0]);
|
||||
print &ui_hidden("zone", $_[0]);
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
print &ui_table_start($text{'findfree_sopt'}, undef, 2);
|
||||
|
||||
@@ -150,7 +147,7 @@ print &ui_form_end([ [ undef, $text{'findfree_search'} ] ]);
|
||||
sub frecs_table
|
||||
{
|
||||
print &ui_grid_table(
|
||||
[ map { "<a href='edit_recs.cgi?index=$in{'index'}&view=$in{'view'}".
|
||||
[ map { "<a href='edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}".
|
||||
"&type=A&newvalue=$_->{'ip'}'>$_->{'ip'}</a>" } @_ ],
|
||||
4, 100, [ "width=25%", "width=25%", "width=25%", "width=25%" ]);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'ro'} && &error($text{'restart_ecannot'});
|
||||
$access{'apply'} || &error($text{'restart_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
if ($zone->{'view'}) {
|
||||
# Reload a zone in a view
|
||||
$dom = $zone->{'name'};
|
||||
@@ -27,5 +27,5 @@ if ($? || $out =~ /failed|not found|error/i) {
|
||||
$tv = $zone->{'type'};
|
||||
&redirect(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}");
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -167,13 +167,13 @@ elsif (@zones && (!@views || !$config{'by_view'})) {
|
||||
push(@ztitles, $zn." ".
|
||||
&text('index_view', "<tt>$z->{'view'}</tt>"));
|
||||
push(@zdels, &can_edit_zone($z, $vw) ?
|
||||
$z->{'index'}." ".$z->{'viewindex'} : undef);
|
||||
$z->{'name'}." ".$z->{'viewindex'} : undef);
|
||||
}
|
||||
else {
|
||||
push(@zlinks, "edit_$t.cgi?zone=$z->{'name'}");
|
||||
push(@ztitles, $zn);
|
||||
push(@zdels, &can_edit_zone($z) ?
|
||||
$z->{'index'} : undef);
|
||||
$z->{'name'} : undef);
|
||||
}
|
||||
push(@zsort, $t eq 'hint' ? undef : $ztitles[$#ztitles]);
|
||||
push(@zicons, "images/$t.gif");
|
||||
@@ -235,18 +235,18 @@ elsif (@zones && (!@views || !$config{'by_view'})) {
|
||||
$mid = int((@zlinks+1)/2);
|
||||
@grid = ( );
|
||||
if (&have_dnssec_tools_support()) {
|
||||
push(@grid, &zones_table([ @zlinks[0 .. $mid-1] ],
|
||||
[ @ztitles[0 .. $mid-1] ],
|
||||
[ @ztypes[0 .. $mid-1] ],
|
||||
[ @zdels[0 .. $mid-1] ],
|
||||
[ @zstatus[0 .. $mid-1] ]));
|
||||
} else {
|
||||
push(@grid, &zones_table([ @zlinks[0 .. $mid-1] ],
|
||||
[ @ztitles[0 .. $mid-1] ],
|
||||
[ @ztypes[0 .. $mid-1] ],
|
||||
[ @zdels[0 .. $mid-1] ]));
|
||||
|
||||
}
|
||||
push(@grid, &zones_table([ @zlinks[0 .. $mid-1] ],
|
||||
[ @ztitles[0 .. $mid-1] ],
|
||||
[ @ztypes[0 .. $mid-1] ],
|
||||
[ @zdels[0 .. $mid-1] ],
|
||||
[ @zstatus[0 .. $mid-1] ]));
|
||||
}
|
||||
else {
|
||||
push(@grid, &zones_table([ @zlinks[0 .. $mid-1] ],
|
||||
[ @ztitles[0 .. $mid-1] ],
|
||||
[ @ztypes[0 .. $mid-1] ],
|
||||
[ @zdels[0 .. $mid-1] ]));
|
||||
}
|
||||
if ($mid < @zlinks) {
|
||||
if (&have_dnssec_tools_support()) {
|
||||
push(@grid, &zones_table([ @zlinks[$mid .. $#zlinks] ],
|
||||
|
||||
@@ -63,6 +63,9 @@ index_bind=BIND
|
||||
|
||||
master_title=Edit Master Zone
|
||||
master_ecannot=You are not allowed to edit this zone
|
||||
master_egone=Zone $1 does not exist in any view
|
||||
master_egone2=Zone $1 does not exist!
|
||||
master_egone3=Zone $1 in view $2 does not exist!
|
||||
master_eviewcannot=You are not allowed to create a zone in that view
|
||||
master_manual=Edit Records File
|
||||
master_soa=Edit Zone Parameters
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'gen'} || &error($text{'gen_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'recs_ecannot'});
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
|
||||
$desc = &text('recs_header', &ip6int_to_net(&arpa_to_ip($dom)));
|
||||
&ui_print_header($desc, $text{'gen_title'}, "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
@@ -16,7 +17,7 @@ $desc = &text('recs_header', &ip6int_to_net(&arpa_to_ip($dom)));
|
||||
@gens = grep { $_->{'generate'} } &read_zone_file($zone->{'file'}, $dom);
|
||||
print "$text{'gen_desc'}<p>\n";
|
||||
print &ui_form_start("save_gen.cgi", "post");
|
||||
print &ui_hidden("index", $in{'index'});
|
||||
print &ui_hidden("zone", $in{'zone'});
|
||||
print &ui_hidden("view", $in{'view'});
|
||||
|
||||
print &ui_columns_start([ $text{'gen_type'}, $text{'gen_range'},
|
||||
@@ -52,6 +53,6 @@ if (@gens) {
|
||||
}
|
||||
print &ui_form_end(\@buts);
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
|
||||
@@ -24,13 +24,14 @@ elsif ($in{'rdelete'}) {
|
||||
|
||||
# Get the zones
|
||||
foreach $d (split(/\0/, $in{'d'})) {
|
||||
($idx, $viewidx) = split(/\s+/, $d);
|
||||
if ($viewidx ne '') {
|
||||
$view = $conf->[$viewidx];
|
||||
$zconf = $view->{'members'}->[$idx];
|
||||
($zonename, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name_or_error($zonename, $viewidx);
|
||||
if ($zone->{'viewindex'} ne '') {
|
||||
$view = $conf->[$zone->{'viewindex'}];
|
||||
$zconf = $view->{'members'}->[$zone->{'index'}];
|
||||
}
|
||||
else {
|
||||
$zconf = $conf->[$idx];
|
||||
$zconf = $conf->[$zone->{'index'}];
|
||||
}
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
&error($text{'master_edelete'});
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
&error_setup($text{'rmass_err'});
|
||||
|
||||
# Get the zones
|
||||
foreach $d (split(/\0/, $in{'d'})) {
|
||||
($idx, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name($idx, $viewidx);
|
||||
($zonename, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name_or_error($zonename, $viewidx);
|
||||
$zone || &error($text{'umass_egone'});
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_edelete'});
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
&error_setup($text{'umass_err'});
|
||||
|
||||
# Get the zones
|
||||
foreach $d (split(/\0/, $in{'d'})) {
|
||||
($idx, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name($idx, $viewidx);
|
||||
($zonename, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name_or_error($zonename, $viewidx);
|
||||
$zone || &error($text{'umass_egone'});
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_edelete'});
|
||||
|
||||
@@ -3,13 +3,12 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
&error_setup($text{'umass_err'});
|
||||
|
||||
# Get the zones
|
||||
foreach $d (split(/\0/, $in{'d'})) {
|
||||
($idx, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name($idx, $viewidx);
|
||||
($zonename, $viewidx) = split(/\s+/, $d);
|
||||
$zone = &get_zone_name_or_error($zonename, $viewidx);
|
||||
$zone || &error($text{'umass_egone'});
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_edelete'});
|
||||
|
||||
@@ -4,30 +4,38 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
# Get the object for the new view
|
||||
$pconf = &get_config_parent();
|
||||
$conf = $pconf->{'members'};
|
||||
$nconf = $conf->[$in{'newview'}];
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&can_edit_zone($zconf, $view) || &error($text{'master_ecannot'});
|
||||
$in{'view'} ne $in{'newview'} || &error($text{'master_emove'});
|
||||
|
||||
# If the zone is in a view currently, get it too
|
||||
$oldpconf = $zone->{'viewindex'} ? $conf->[$zone->{'viewindex'}] : $pconf;
|
||||
|
||||
$in{'view'} eq $in{'newview'} && &error($text{'master_emove'});
|
||||
&can_edit_view($nconf) || &error($text{'master_eviewcannot'});
|
||||
|
||||
# Delete from the view
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
&save_directive($pconf, [ $zconf ], [ ], 0);
|
||||
# Delete from the old view (or top level)
|
||||
&lock_file(&make_chroot($z->{'file'}));
|
||||
&save_directive($oldpconf, [ $z ], [ ], 0);
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
&unlock_file(&make_chroot($z->{'file'}));
|
||||
|
||||
# Create in new view
|
||||
delete($z->{'file'}); # May not be valid anymore after move
|
||||
&lock_file(&make_chroot($nconf->{'file'}));
|
||||
&save_directive($nconf, undef, [ $zconf ], 1);
|
||||
&save_directive($nconf, undef, [ $z ], 1);
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($nconf->{'file'}));
|
||||
&webmin_log("move", undef, $zconf->{'value'}, \%in);
|
||||
&webmin_log("move", undef, $dom, \%in);
|
||||
|
||||
&redirect("");
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
|
||||
# Work out the filename
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
&can_edit_zone($zone, $view) ||
|
||||
&error($text{'hint_ecannot'});
|
||||
$file = $zone->{'file'};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&error_setup($text{'resign_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -17,5 +17,5 @@ $err = &resign_dnssec_key($zone);
|
||||
|
||||
# Return to master page
|
||||
&webmin_log("resign", undef, $dom);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'ro'} && &error($text{'restart_ecannot'});
|
||||
$access{'apply'} || &error($text{'restart_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
&can_edit_zone($zone) || &error($text{'restart_ecannot'});
|
||||
$err = &restart_zone($zone->{'name'}, $zone->{'view'});
|
||||
&error($err) if ($err);
|
||||
@@ -19,6 +19,6 @@ if ($in{'return'}) {
|
||||
else {
|
||||
&redirect(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}");
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/usr/local/bin/perl
|
||||
# save_delegation.cgi
|
||||
# Save changes to delegation zone options in named.conf
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
$indent = 2;
|
||||
}
|
||||
else {
|
||||
$indent = 1;
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
&error_setup($text{'delegation_err'});
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
&error($text{'delegation_ecannot'});
|
||||
$access{'ro'} && &error($text{'master_ero'});
|
||||
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
|
||||
&redirect("");
|
||||
|
||||
@@ -4,27 +4,24 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
$indent = 2;
|
||||
}
|
||||
else {
|
||||
$indent = 1;
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
&error_setup($text{'fwd_err'});
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
&error($text{'fwd_ecannot'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
$indent = $zone->{'view'} ? 2 : 1;
|
||||
|
||||
&lock_file(&make_chroot($z->{'file'}));
|
||||
$access{'ro'} && &error($text{'master_ero'});
|
||||
|
||||
&save_forwarders("forwarders", $zconf, $indent);
|
||||
&save_choice("check-names", $zconf, $indent);
|
||||
&save_choice("forward", $zconf, $indent);
|
||||
&save_forwarders("forwarders", $z, $indent);
|
||||
&save_choice("check-names", $z, $indent);
|
||||
&save_choice("forward", $z, $indent);
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
|
||||
&unlock_file(&make_chroot($z->{'file'}));
|
||||
&webmin_log("opts", undef, $dom, \%in);
|
||||
&redirect("");
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'gen'} || &error($text{'gen_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'recs_ecannot'});
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
|
||||
$file = $zone->{'file'};
|
||||
@recs = &read_zone_file($file, $dom);
|
||||
@gens = grep { $_->{'generate'} } @recs;
|
||||
@@ -54,7 +55,7 @@ if ($in{'show'}) {
|
||||
}
|
||||
print &ui_columns_end();
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
exit;
|
||||
}
|
||||
@@ -104,5 +105,5 @@ for($i=0; defined($in{"type_$i"}); $i++) {
|
||||
}
|
||||
&bump_soa_record($file, \@recs);
|
||||
&sign_dnssec_zone_if_key($zone, \@recs);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,31 +4,28 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
$indent = 2;
|
||||
}
|
||||
else {
|
||||
$indent = 1;
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
&error_setup($text{'master_err'});
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
$indent = $zone->{'view'} ? 2 : 1;
|
||||
|
||||
$access{'ro'} && &error($text{'master_ero'});
|
||||
$access{'opts'} || &error($text{'master_eoptscannot'});
|
||||
&lock_file(&make_chroot($z->{'file'}));
|
||||
|
||||
&save_choice("check-names", $zconf, $indent);
|
||||
&save_choice("notify", $zconf, $indent);
|
||||
&save_address("allow-update", $zconf, $indent);
|
||||
&save_address("allow-transfer", $zconf, $indent);
|
||||
&save_address("allow-query", $zconf, $indent);
|
||||
&save_address("also-notify", $zconf, $indent);
|
||||
&save_choice("check-names", $z, $indent);
|
||||
&save_choice("notify", $z, $indent);
|
||||
&save_address("allow-update", $z, $indent);
|
||||
&save_address("allow-transfer", $z, $indent);
|
||||
&save_address("allow-query", $z, $indent);
|
||||
&save_address("also-notify", $z, $indent);
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&unlock_file(&make_chroot($z->{'file'}));
|
||||
&webmin_log("opts", undef, $dom, \%in);
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
&error_setup($text{'edit_err'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
@zl = &list_zone_names();
|
||||
$reverse = ($in{'origin'} =~ /\.in-addr\.arpa/i ||
|
||||
@@ -45,7 +45,7 @@ if ($in{'delete'}) {
|
||||
[ [ 'confirm', $text{'edit_dok'} ] ],
|
||||
);
|
||||
|
||||
&ui_print_footer("edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'redirtype'}&sort=$in{'sort'}", $text{'recs_return'});
|
||||
&ui_print_footer("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'redirtype'}&sort=$in{'sort'}", $text{'recs_return'});
|
||||
}
|
||||
else {
|
||||
# Delete the record
|
||||
@@ -90,7 +90,7 @@ if ($in{'delete'}) {
|
||||
&sign_dnssec_zone_if_key($ofwdconf, \@ofrecs);
|
||||
}
|
||||
|
||||
&redirect("edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&type=$in{'redirtype'}&sort=$in{'sort'}");
|
||||
&redirect("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'redirtype'}&sort=$in{'sort'}");
|
||||
&unlock_all_files();
|
||||
&webmin_log('delete', 'record', $in{'origin'}, $r);
|
||||
}
|
||||
@@ -543,7 +543,7 @@ else {
|
||||
&unlock_all_files();
|
||||
$r->{'newvalues'} = $vals;
|
||||
&webmin_log($in{'new'} ? 'create' : 'modify', 'record', $in{'origin'}, $r);
|
||||
&redirect("edit_recs.cgi?index=$in{'index'}&view=$in{'view'}&".
|
||||
&redirect("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&".
|
||||
"type=$in{'redirtype'}&sort=$in{'sort'}");
|
||||
|
||||
# valname(name)
|
||||
|
||||
@@ -4,36 +4,33 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
$indent = 2;
|
||||
}
|
||||
else {
|
||||
$indent = 1;
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}];
|
||||
&lock_file(&make_chroot($zconf->{'file'}));
|
||||
&error_setup($text{'slave_err'});
|
||||
&can_edit_zone($zconf, $view) ||
|
||||
&error($text{'slave_ecannot'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
$indent = $zone->{'view'} ? 2 : 1;
|
||||
|
||||
$access{'ro'} && &error($text{'master_ero'});
|
||||
$access{'opts'} || &error($text{'master_eoptscannot'});
|
||||
&lock_file(&make_chroot($z->{'file'}));
|
||||
|
||||
&save_port_address("masters", "port", $zconf, $indent);
|
||||
&save_opt("max-transfer-time-in", \&mtti_check, $zconf, $indent);
|
||||
&save_opt("file", \&file_check, $zconf, $indent);
|
||||
&save_choice("check-names", $zconf, $indent);
|
||||
&save_choice("notify", $zconf, $indent);
|
||||
&save_addr_match("allow-update", $zconf, $indent);
|
||||
&save_addr_match("allow-transfer", $zconf, $indent);
|
||||
&save_addr_match("allow-query", $zconf, $indent);
|
||||
&save_address("also-notify", $zconf, $indent);
|
||||
&save_port_address("masters", "port", $z, $indent);
|
||||
&save_opt("max-transfer-time-in", \&mtti_check, $z, $indent);
|
||||
&save_opt("file", \&file_check, $z, $indent);
|
||||
&save_choice("check-names", $z, $indent);
|
||||
&save_choice("notify", $z, $indent);
|
||||
&save_addr_match("allow-update", $z, $indent);
|
||||
&save_addr_match("allow-transfer", $z, $indent);
|
||||
&save_addr_match("allow-query", $z, $indent);
|
||||
&save_address("also-notify", $z, $indent);
|
||||
&flush_file_lines();
|
||||
&unlock_file(&make_chroot($zconf->{'file'}));
|
||||
&webmin_log("opts", undef, $zconf->{'value'}, \%in);
|
||||
&redirect("edit_slave.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&unlock_file(&make_chroot($z->{'file'}));
|
||||
&webmin_log("opts", undef, $dom, \%in);
|
||||
&redirect("edit_slave.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
sub mtti_check
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
&error_setup($text{'master_err2'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -74,5 +74,5 @@ elsif ($defttl && $in{'defttl_def'}) {
|
||||
|
||||
&unlock_file(&make_chroot($file));
|
||||
&webmin_log("soa", undef, $in{'origin'}, \%in);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParseMime();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$file = &absolute_path($zone->{'file'});
|
||||
$tv = $zone->{'type'};
|
||||
&can_edit_zone($zone) ||
|
||||
@@ -32,5 +32,5 @@ if ($in{'soa'}) {
|
||||
&unlock_file(&make_chroot($file));
|
||||
&webmin_log("text", undef, $zone->{'name'},
|
||||
{ 'file' => $file });
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
require './bind8-lib.pl';
|
||||
&error_setup($text{'sign_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -17,5 +17,5 @@ $err = &sign_dnssec_zone($zone, 1);
|
||||
|
||||
# Return to master page
|
||||
&webmin_log("sign", undef, $dom);
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'ro'} && &error($text{'restart_ecannot'});
|
||||
$access{'apply'} || &error($text{'restart_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
if ($zone->{'view'}) {
|
||||
# Reload a zone in a view
|
||||
$dom = $zone->{'name'};
|
||||
@@ -27,5 +27,5 @@ if ($? || $out =~ /failed|not found|error/i) {
|
||||
$tv = $zone->{'type'};
|
||||
&redirect(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}");
|
||||
"?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$file = &absolute_path($zone->{'file'});
|
||||
$tv = $zone->{'type'};
|
||||
&can_edit_zone($zone) ||
|
||||
@@ -27,4 +27,4 @@ else {
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}", $text{'master_return'});
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$access{'whois'} || &error($text{'whois_ecannot'});
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) || &error($text{'master_ecannot'});
|
||||
|
||||
$tv = $zone->{'type'};
|
||||
$dom =~ s/\.$//;
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($dom));
|
||||
&ui_print_header($desc, $text{'whois_title'}, "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
@@ -50,5 +51,5 @@ print &ui_table_end();
|
||||
|
||||
&ui_print_footer(($tv eq "master" ? "edit_master.cgi" :
|
||||
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi").
|
||||
"?index=$in{'index'}&view=$in{'view'}", $text{'master_return'});
|
||||
"?zone=$in{'zone'}&view=$in{'view'}", $text{'master_return'});
|
||||
|
||||
|
||||
@@ -3,25 +3,18 @@
|
||||
|
||||
require './bind8-lib.pl';
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
|
||||
$z = &zone_to_config($zone);
|
||||
$zconf = $z->{'members'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
|
||||
# Get config object
|
||||
$bconf = $conf = &get_config();
|
||||
if ($in{'view'} ne '') {
|
||||
$view = $conf->[$in{'view'}];
|
||||
$conf = $view->{'members'};
|
||||
}
|
||||
$zconf = $conf->[$in{'index'}]->{'members'};
|
||||
$file = &find_value("file", $zconf);
|
||||
|
||||
$desc = &ip6int_to_net(&arpa_to_ip($zone->{'name'}));
|
||||
&ui_print_header($desc, $text{'xfer_title'}, "",
|
||||
undef, undef, undef, undef, &restart_links($zone));
|
||||
|
||||
# Get transfer source IP
|
||||
$options = &find("options", $bconf);
|
||||
$options = &find("options", $zconf);
|
||||
$src = &find("transfer-source", $options->{'members'});
|
||||
|
||||
# Get master IPs
|
||||
@@ -54,5 +47,5 @@ if (-r $temp) {
|
||||
}
|
||||
&unlink_file($temp);
|
||||
|
||||
&ui_print_footer("edit_slave.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_slave.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
@@ -9,7 +9,7 @@ local $err;
|
||||
|
||||
&error_setup($text{'dt_zone_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_on_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -44,5 +44,5 @@ if (&have_dnssec_tools_support()) {
|
||||
}
|
||||
|
||||
# Return to master page
|
||||
&redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
|
||||
&redirect("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}");
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ local $err;
|
||||
|
||||
&error_setup($text{'dt_zone_err'});
|
||||
&ReadParse();
|
||||
$zone = &get_zone_name($in{'index'}, $in{'view'});
|
||||
$zone = &get_zone_name_on_error($in{'zone'}, $in{'view'});
|
||||
$dom = $zone->{'name'};
|
||||
&can_edit_zone($zone) ||
|
||||
&error($text{'master_ecannot'});
|
||||
@@ -75,5 +75,5 @@ if (&have_dnssec_tools_support()) {
|
||||
&webmin_log("migrate", undef, $dom);
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
|
||||
&ui_print_footer("edit_master.cgi?zone=$in{'zone'}&view=$in{'view'}",
|
||||
$text{'master_return'});
|
||||
|
||||
Reference in New Issue
Block a user