Handle hostnames with upper-case letters
[webmin.git] / bind8 / save_misc.cgi
1 #!/usr/local/bin/perl
2 # save_misc.cgi
3 # Save global miscellaneous options
4
5 require './bind8-lib.pl';
6 $access{'defaults'} || &error($text{'misc_ecannot'});
7 &error_setup($text{'misc_err'});
8 &ReadParse();
9
10 &lock_file(&make_chroot($config{'named_conf'}));
11 $conf = &get_config();
12 $options = &find("options", $conf);
13 &save_opt("coresize", \&size_check, $options, 1);
14 &save_opt("datasize", \&size_check, $options, 1);
15 &save_opt("files", \&files_check, $options, 1);
16 &save_opt("stacksize", \&size_check, $options, 1);
17 &save_opt("cleaning-interval", \&mins_check, $options, 1);
18 &save_opt("interface-interval", \&mins_check, $options, 1);
19 &save_opt("statistics-interval", \&mins_check, $options, 1);
20 &save_choice("recursion", $options, 1);
21 &save_choice("multiple-cnames", $options, 1);
22 &save_choice("fetch-glue", $options, 1);
23 &save_choice("auth-nxdomain", $options, 1);
24
25 &flush_file_lines();
26 &unlock_file(&make_chroot($config{'named_conf'}));
27 &webmin_log("misc", undef, undef, \%in);
28 &redirect("");
29
30 sub size_check
31 {
32 return $_[0] =~ /^\d+[kmg]*$/i ? "" : $text{'misc_esize'};
33 }
34
35 sub files_check
36 {
37 return $_[0] =~ /^\d+$/i ? "" : $text{'misc_efiles'};
38 }
39
40 sub mins_check
41 {
42 return $_[0] =~ /^\d+$/i ? "" : $text{'misc_emins'};
43 }
44