Handle hostnames with upper-case letters
[webmin.git] / dnsadmin / edit_text.cgi
1 #!/usr/local/bin/perl
2 # edit_text.cgi
3 # Display a form for manually editing a records file
4
5 require './dns-lib.pl';
6 &ReadParse();
7 %access = &get_module_acl();
8 $zconf = &get_config()->[$in{'index'}];
9 &can_edit_zone(\%access, $zconf->{'values'}->[0]) ||
10         &error("You are not allowed to edit this zone");
11 $file = &absolute_path($zconf->{'values'}->[1]);
12 &header("Edit Records File", "");
13 print "<center><font size=+1>$file</font></center>\n";
14 print &ui_hr();
15
16 open(FILE, $file);
17 while(<FILE>) {
18         push(@lines, &html_escape($_));
19         }
20 close(FILE);
21
22 print "This form allows you to manually edit the DNS records file\n";
23 print "<tt>$file</tt>. No syntax checking will be done by webmin,\n";
24 print "and the zone serial number will not be automatically incremented. <p>\n";
25
26 print "<form action=save_text.cgi method=post enctype=multipart/form-data>\n";
27 print "<input type=hidden name=index value=\"$in{'index'}\">\n";
28 print "<textarea name=text rows=20 cols=80>",
29         join("", @lines),"</textarea><p>\n";
30 print "<input type=submit value=Save> <input type=reset value=Undo></form>\n";
31
32 print &ui_hr();
33 &footer("edit_master.cgi?index=$in{'index'}", "record types");
34