Handle hostnames with upper-case letters
[webmin.git] / dhcpd / edit_text.cgi
1 #!/usr/bin/perl
2 # $Id: edit_text.cgi,v 1.2 2005/04/16 14:30:21 jfranken Exp $
3 # File added 2005-04-15 by Johannes Franken <jfranken@jfranken.de>
4 # Distributed under the terms of the GNU General Public License, v2 or later
5 #
6 # * Display form to manually edit dhcpd.conf file (pass to save_text.cgi)
7
8 require './dhcpd-lib.pl';
9 $access{'noconfig'} && &error($text{'text_ecannot'});
10 $conf = &get_config();
11 &ui_print_header($text{'text_editor'}, $text{'text_title'}, "");
12
13 open(FILE, $config{'dhcpd_conf'});
14 while(<FILE>) {
15         push(@lines, &html_escape($_));
16         }
17 close(FILE);
18
19 if (!$access{'ro'}) {
20         print &text('text_desc', "<tt>$file</tt>"),"<p>\n";
21         }
22
23 print "<form action=save_text.cgi method=post enctype=multipart/form-data>\n";
24 print "<textarea name=text rows=20 cols=80>",
25         join("", @lines),"</textarea><p>\n";
26 print "<input type=submit value=\"$text{'save'}\"> ",
27       "<input type=reset value=\"$text{'text_undo'}\">\n"
28         if (!$access{'ro'});
29 print "</form>\n";
30
31 &ui_print_footer("",$text{'text_return'});