From 118f705eb407db112b76d188a05e8ead4ba9ae14 Mon Sep 17 00:00:00 2001 From: Bradley Kite Date: Mon, 23 Feb 2015 11:06:41 +0000 Subject: [PATCH] Allow "transfer-source" to be specified so slave zones within the views can match the correct view on the master. --- bind8/edit_view.cgi | 3 +++ bind8/save_view.cgi | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/bind8/edit_view.cgi b/bind8/edit_view.cgi index 40d1f464b..fb0046241 100755 --- a/bind8/edit_view.cgi +++ b/bind8/edit_view.cgi @@ -44,6 +44,9 @@ print &address_input($text{'master_query'}, "allow-query", $vconf); print &address_input($text{'master_notify2'}, "also-notify", $vconf); print &address_input($text{'master_notify3'}, "allow-notify", $vconf); +$src = &find("transfer-source", $vconf); +print &ui_table_row($text{'net_taddr'}, &ui_textbox("transfer-source", $src->{'values'}->[0], 15)); + print &ui_table_end(); if ($access{'ro'}) { diff --git a/bind8/save_view.cgi b/bind8/save_view.cgi index 9bda184b3..12a5f19f4 100755 --- a/bind8/save_view.cgi +++ b/bind8/save_view.cgi @@ -20,6 +20,23 @@ $access{'ro'} && &error($text{'view_ecannot'}); &save_address("allow-query", $view, 1); &save_address("also-notify", $view, 1); &save_address("allow-notify", $view, 1); + +if ($in{'transfer-source'}) +{ + &check_ipaddress($in{'transfer-source'}) || &error(&text('net_eaddr', $in{'transfer-source'})); + push(@tvals, $in{'transfer-source'}); + if (@tvals) + { + &save_directive($view, 'transfer-source', + [ { 'name' => 'transfer-source', + 'values' => \@tvals } ], 1); + } +} +else +{ + &save_directive($view, 'transfer-source', [], 1); +} + &flush_file_lines(); &unlock_file(&make_chroot($view->{'file'})); &webmin_log("view", undef, $view->{'value'}, \%in);