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