Handle hostnames with upper-case letters
[webmin.git] / dnsadmin / edit_slave.cgi
1 #!/usr/local/bin/perl
2 # edit_slave.cgi
3 # Display options for an existing slave or stub zone
4
5 require './dns-lib.pl';
6 &ReadParse();
7 $conf = &get_config();
8 @v = @{$conf->[$in{'index'}]->{'values'}};
9 %access = &get_module_acl();
10 &can_edit_zone(\%access, $v[0]) ||
11         &error("You are not allowed to edit this zone");
12 &header("Edit Slave Zone", "");
13 print "<center><font size=+2>",&arpa_to_ip($v[0]),"</font></center>\n";
14
15 print &ui_hr();
16 print "<form action=save_slave.cgi>\n";
17 print "<input type=hidden name=index value=\"$in{'index'}\">\n";
18 print "<table border width=100%>\n";
19 print "<tr $tb> <td><b>Slave Zone Options</b></td> </tr>\n";
20 print "<tr $cb> <td><table>\n";
21
22 for($i=1; $i<@v; $i++) {
23         if (&check_ipaddress($v[$i])) { push(@mast, $v[$i]); }
24         else { $file = $v[$i]; }
25         }
26 print "<tr> <td valign=top><b>Master servers</b></td>\n";
27 print "<td><textarea name=masters rows=4 cols=30>",
28       join("\n", @mast),"</textarea></td> </tr>\n";
29 print "<tr><td valign=top><b>Records file</b></td> <td valign=top>\n";
30 printf "<input type=radio name=file_def value=1 %s> None\n",
31         $file ? "" : "checked";
32 printf "<input type=radio name=file_def value=0 %s>\n",
33         $file ? "checked" : "";
34 print "<input name=file size=30 value=\"$file\">",
35         &file_chooser_button("file"),"</td> </tr>\n";
36
37 print "</table></td></tr> </table>\n";
38 print "<table width=100%><tr><td align=left>\n";
39 print "<input type=submit value=Save></td></form>\n";
40 print "<form action=delete_zone.cgi>\n";
41 print "<input type=hidden name=index value=\"$in{'index'}\">\n";
42 print "<td align=right><input type=submit value=Delete></td></form>\n";
43 print "</tr></table>\n";
44 print &ui_hr();
45 &footer("", "zone list");
46