Handle hostnames with upper-case letters
[webmin.git] / bind8 / save_master.cgi
1 #!/usr/local/bin/perl
2 # save_master.cgi
3 # Save changes to master zone options in named.conf
4
5 require './bind8-lib.pl';
6 &ReadParse();
7 $conf = &get_config();
8 if ($in{'view'} ne '') {
9         $view = $conf->[$in{'view'}];
10         $conf = $view->{'members'};
11         $indent = 2;
12         }
13 else {
14         $indent = 1;
15         }
16 $zconf = $conf->[$in{'index'}];
17 &lock_file(&make_chroot($zconf->{'file'}));
18 &error_setup($text{'master_err'});
19 &can_edit_zone($zconf, $view) ||
20         &error($text{'master_ecannot'});
21 $access{'ro'} && &error($text{'master_ero'});
22 $access{'opts'} || &error($text{'master_eoptscannot'});
23
24 &save_choice("check-names", $zconf, $indent);
25 &save_choice("notify", $zconf, $indent);
26 &save_address("allow-update", $zconf, $indent);
27 &save_address("allow-transfer", $zconf, $indent);
28 &save_address("allow-query", $zconf, $indent);
29 &save_address("also-notify", $zconf, $indent);
30 &flush_file_lines();
31 &unlock_file(&make_chroot($zconf->{'file'}));
32 &webmin_log("opts", undef, $zconf->{'value'}, \%in);
33 &redirect("edit_master.cgi?index=$in{'index'}&view=$in{'view'}");
34