Handle hostnames with upper-case letters
[webmin.git] / proftpd / allmanual_save.cgi
1 #!/usr/local/bin/perl
2 # allmanual_save.cgi
3 # Save an entire config file
4
5 require './proftpd-lib.pl';
6 &ReadParseMime();
7
8 $conf = &get_config();
9 @files = &unique(map { $_->{'file'} } @$conf);
10 &indexof($in{'file'}, @files) >= 0 || &error($text{'manual_efile'});
11
12 $temp = &transname();
13 system("cp ".quotemeta($in{'file'})." $temp");
14 $in{'data'} =~ s/\r//g;
15 &open_lock_tempfile(FILE, ">$in{'file'}");
16 &print_tempfile(FILE, $in{'data'});
17 &close_tempfile(FILE);
18 if ($config{'test_manual'}) {
19         $err = &test_config();
20         if ($err) {
21                 system("mv $temp ".quotemeta($in{'file'}));
22                 &error(&text('manual_etest', "<pre>$err</pre>"));
23                 }
24         }
25 unlink($temp);
26 &redirect("");
27