Handle hostnames with upper-case letters
[webmin.git] / apache / delete_htaccess.cgi
1 #!/usr/local/bin/perl
2 # delete_htaccess.cgi
3 # Delete some .htaccess or similar file
4
5 require './apache-lib.pl';
6 &ReadParse();
7 &allowed_auth_file($in{'file'}) ||
8         &error($text{'htaccess_edelete'});
9 &lock_file($in{'file'});
10 unlink($in{'file'});
11 &unlock_file($in{'file'});
12
13 &read_file("$module_config_directory/site", \%site);
14 @ht = split(/\s+/, $site{'htaccess'});
15 $site{'htaccess'} = join(' ', (grep { $_ ne $in{'file'} } @ht));
16 &write_file("$module_config_directory/site", \%site);
17 &webmin_log("htaccess", "delete", $in{'file'});
18 &redirect("htaccess.cgi");
19