Handle hostnames with upper-case letters
[webmin.git] / wuftpd / save_alias.cgi
1 #!/usr/local/bin/perl
2 # save_alias.cgi
3 # Save alias options
4
5 require './wuftpd-lib.pl';
6 &error_setup($text{'alias_err'});
7 &ReadParse();
8 &lock_file($config{'ftpaccess'});
9 $conf = &get_ftpaccess();
10
11 # save alias directives
12 for($i=0; defined($from = $in{"from_$i"}); $i++) {
13         $to = $in{"to_$i"};
14         next if (!$from);
15         $from =~ /^\S+$/ || &error(&text('alias_efrom', $from));
16         -d $to || &error(&text('alias_eto', $to));
17         push(@alias, { 'name' => 'alias',
18                        'values' => [ $from, $to ] } );
19         }
20 &save_directive($conf, 'alias', \@alias);
21
22 # save cdpath directives
23 foreach $c (split(/\s+/, $in{'cdpath'})) {
24         -d $c || &error(&text('alias_ecdpath', $c));
25         push(@cdpath, { 'name' => 'cdpath',
26                         'values' => [ $c ] } );
27         }
28 &save_directive($conf, 'cdpath', \@cdpath);
29
30 &flush_file_lines();
31 &unlock_file($config{'ftpaccess'});
32 &webmin_log("alias", undef, undef, \%in);
33 &redirect("");