Handle hostnames with upper-case letters
[webmin.git] / bind8 / conf_controls.cgi
1 #!/usr/local/bin/perl
2 # Display NDC control interface options
3
4 require './bind8-lib.pl';
5 $access{'defaults'} || &error($text{'controls_ecannot'});
6 &ui_print_header(undef, $text{'controls_title'}, "",
7                  undef, undef, undef, undef, &restart_links());
8
9 $conf = &get_config();
10 $controls = &find("controls", $conf);
11 $inet = &find("inet", $controls->{'members'});
12 $unix = &find("unix", $controls->{'members'});
13
14 print &ui_form_start("save_controls.cgi", "post");
15 print &ui_table_start($text{'controls_header'}, undef, 2);
16
17 # Show options for inet control
18 if ($inet) {
19         @v = @{$inet->{'values'}};
20         $ip = shift(@v);
21         while(@v) {
22                 $n = shift(@v);
23                 if ($n eq "port") { $port = shift(@v); }
24                 }
25         }
26 print &ui_table_row($text{'controls_inetopt'},
27             &ui_radio("inet", $inet ? 1 : 0,
28                       [ [ 0, $text{'no'} ],
29                         [ 1, &text('controls_inetyes',
30                                    &ui_textbox("ip", $ip, 15),
31                                    &ui_textbox("port", $port, 6)) ] ]));
32
33 # Show allowed addresses for inet control
34 print &ui_table_row($text{'controls_allowips'},
35             &ui_textarea("allow",
36                         join("\n", map { $_->{'name'} }
37                                 @{$inet->{'members'}->{'allow'}}), 5, 20));
38
39 # Show keys for inet control
40 print &ui_table_row($text{'controls_keys'},
41             &ui_textarea("keys",
42                         join("\n", map { $_->{'name'} }
43                                 @{$inet->{'members'}->{'keys'}}), 3, 20));
44
45 print &ui_table_hr();
46
47 # Show options for local socket control
48 if ($unix) {
49         @v = @{$unix->{'values'}};
50         $path = shift(@v);
51         while(@v) {
52                 $n = shift(@v);
53                 if ($n eq "perm") { $perm = shift(@v); }
54                 elsif ($n eq "owner") { $owner = getpwuid(shift(@v)); }
55                 elsif ($n eq "group") { $group = getgrgid(shift(@v)); }
56                 }
57         }
58 print &ui_table_row($text{'controls_unixopt'},
59             &ui_radio("unix", $unix ? 1 : 0,
60                       [ [ 0, $text{'no'} ],
61                         [ 1, &text('controls_unixyes',
62                                    &ui_textbox("path", $path, 30)) ] ]));
63 print &ui_table_row($text{'controls_unixperm'},
64                     &ui_textbox("perm", $perm, 4));
65 print &ui_table_row($text{'controls_unixowner'},
66                     &ui_user_textbox("owner", $owner, 4));
67 print &ui_table_row($text{'controls_unixgroup'},
68                     &ui_group_textbox("group", $group, 4));
69
70
71 print &ui_table_end();
72 print &ui_form_end([ [ "save", $text{'save'} ] ]);
73
74 &ui_print_footer("", $text{'index_return'});
75