Handle hostnames with upper-case letters
[webmin.git] / bind8 / save_view.cgi
1 #!/usr/local/bin/perl
2 # save_view.cgi
3 # Update an existing view
4
5 require './bind8-lib.pl';
6 &ReadParse();
7 &error_setup($text{'view_err'});
8 $pconf = &get_config_parent();
9 $conf = $pconf->{'members'};
10 $view = $conf->[$in{'index'}];
11 $access{'views'} || &error($text{'view_ecannot'});
12 &can_edit_view($view) || &error($text{'view_ecannot'});
13 $access{'ro'} && &error($text{'view_ecannot'});
14
15 # Save the view
16 &lock_file(&make_chroot($view->{'file'}));
17 &save_addr_match("match-clients", $view, 1);
18 &save_choice("recursion", $view, 1);
19 &save_address("allow-transfer", $view, 1);
20 &save_address("allow-query", $view, 1);
21 &save_address("also-notify", $view, 1);
22 &save_address("allow-notify", $view, 1);
23 &flush_file_lines();
24 &unlock_file(&make_chroot($view->{'file'}));
25 &webmin_log("view", undef, $view->{'value'}, \%in);
26 &redirect("");
27