3 # Save changes to slave zone options in named.conf
5 require './bind8-lib.pl';
8 if ($in{'view'} ne '') {
9 $view = $conf->[$in{'view'}];
10 $conf = $view->{'members'};
16 $zconf = $conf->[$in{'index'}];
17 &lock_file(&make_chroot($zconf->{'file'}));
18 &error_setup($text{'slave_err'});
19 &can_edit_zone($zconf, $view) ||
20 &error($text{'slave_ecannot'});
21 $access{'ro'} && &error($text{'master_ero'});
22 $access{'opts'} || &error($text{'master_eoptscannot'});
24 &save_port_address("masters", "port", $zconf, $indent);
25 &save_opt("max-transfer-time-in", \&mtti_check, $zconf, $indent);
26 &save_opt("file", \&file_check, $zconf, $indent);
27 &save_choice("check-names", $zconf, $indent);
28 &save_choice("notify", $zconf, $indent);
29 &save_addr_match("allow-update", $zconf, $indent);
30 &save_addr_match("allow-transfer", $zconf, $indent);
31 &save_addr_match("allow-query", $zconf, $indent);
32 &save_address("also-notify", $zconf, $indent);
34 &unlock_file(&make_chroot($zconf->{'file'}));
35 &webmin_log("opts", undef, $zconf->{'value'}, \%in);
36 &redirect("edit_slave.cgi?index=$in{'index'}&view=$in{'view'}");
40 return $_[0] =~ /^\d+$/ ? undef : &text('slave_emax', $_[0]);
45 return $text{'slave_efile'} if ($_[0] !~ /\S/);
48 $file = &base_directory($conf)."/".$file;
50 return &allowed_zone_file(\%access, $file) ? undef :
51 &text('slave_efile2', $_[0]);