Handle hostnames with upper-case letters
[webmin.git] / bind8 / edit_forward.cgi
1 #!/usr/local/bin/perl
2 # edit_forward.cgi
3 # Display options for an existing forward zone
4
5 require './bind8-lib.pl';
6 &ReadParse();
7 $bconf = $conf = &get_config();
8 if ($in{'view'} ne '') {
9         $view = $conf->[$in{'view'}];
10         $conf = $view->{'members'};
11         }
12 $zconf = $conf->[$in{'index'}]->{'members'};
13 $dom = $conf->[$in{'index'}]->{'value'};
14 &can_edit_zone($conf->[$in{'index'}], $view) ||
15         &error($text{'fwd_ecannot'});
16 $desc = &ip6int_to_net(&arpa_to_ip($dom));
17 &ui_print_header($desc, $text{'fwd_title'}, "",
18                  undef, undef, undef, undef, &restart_links());
19
20 # Start of the form
21 print &ui_form_start("save_forward.cgi");
22 print &ui_hidden("index", $in{'index'});
23 print &ui_hidden("view", $in{'view'});
24 print &ui_table_start($text{'fwd_opts'}, "width=100%", 4);
25
26 # Forwarding servers
27 print &forwarders_input($text{'fwd_masters'}, "forwarders", $zconf);
28
29 print &choice_input($text{'fwd_forward'}, "forward", $zconf,
30                     $text{'yes'}, "first", $text{'no'}, "only",
31                     $text{'default'}, undef);
32 print &choice_input($text{'fwd_check'}, "check-names", $zconf,
33                     $text{'warn'}, "warn", $text{'fail'}, "fail",
34                     $text{'ignore'}, "ignore", $text{'default'}, undef);
35
36 print &ui_table_end();
37
38 if ($access{'ro'}) {
39         print &ui_form_end();
40         }
41 else {
42         print &ui_form_end([ [ undef, $text{'save'} ] ]);
43
44         print &ui_hr();
45         print &ui_buttons_start();
46
47         # Move to another view
48         print &move_zone_button($bconf, $in{'view'}, $in{'index'});
49
50         # Delete zone
51         if ($access{'delete'}) {
52                 print &ui_buttons_row("delete_zone.cgi",
53                         $text{'master_del'}, $text{'fwd_delmsg'},
54                         &ui_hidden("index", $in{'index'}).
55                         &ui_hidden("view", $in{'view'}));
56                 }
57
58         print &ui_buttons_end();
59         }
60 &ui_print_footer("", $text{'index_return'});
61