Handle hostnames with upper-case letters
[webmin.git] / dhcpd / save_text.cgi
1 #!/usr/bin/perl
2 # $Id: save_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 # * Save passed text to dhcpd.conf
7
8 require './dhcpd-lib.pl';
9 &ReadParseMime();
10 $access{'noconfig'} && &error($text{'text_ecannot'});
11 $conf = &get_config();
12
13 $file=$config{'dhcpd_conf'};
14 &lock_file($file);
15 $in{'text'} =~ s/\r//g;
16 $in{'text'} .= "\n" if ($in{'text'} !~ /\n$/);
17 &open_tempfile(FILE, ">$file");
18 &print_tempfile(FILE, $in{'text'});
19 &close_tempfile(FILE);
20 &unlock_file($file);
21 &webmin_log("text", undef, $conf->[$in{'index'}]->{'value'},
22             { 'file' => $file });
23 &redirect("");
24