Handle hostnames with upper-case letters
[webmin.git] / proftpd / save_dir.cgi
1 #!/usr/local/bin/perl
2 # save_virt.cgi
3 # Save some kind of per-directory configuration
4
5 require './proftpd-lib.pl';
6 &ReadParse();
7 if ($in{'global'}) {
8         $conf = &get_config();
9         $vconf = &get_or_create_global($conf);
10         }
11 else {
12         ($vconf, $v) = &get_virtual_config($in{'virt'});
13         }
14 if ($in{'anon'}) {
15         $anon = &find_directive_struct("Anonymous", $vconf);
16         $vconf = $anon->{'members'};
17         }
18 $d = $vconf->[$in{'idx'}];
19 $conf = $d->{'members'};
20 @edit = &editable_directives($in{'type'}, 'directory');
21
22 &lock_file($d->{'file'});
23 $tn = $type_name[$in{'type'}]; $tn =~ tr/A-Z/a-z/;
24 &error_setup(&text('efailed', $text{"type_$in{'type'}"}));
25 &parse_inputs(\@edit, $conf, &get_config());
26 &unlock_file($d->{'file'});
27 &webmin_log("dir", $in{'type'},
28             "$v->{'value'}:$d->{'words'}->[0]", \%in);
29
30 &redirect("dir_index.cgi?virt=$in{'virt'}&idx=$in{'idx'}&anon=$in{'anon'}&global=$in{'global'}");