3 # Modify or delete a <Files> clause in a .htaccess file
5 require './apache-lib.pl';
7 $access{'global'} || &error($text{'htaccess_ecannot'});
8 &allowed_auth_file($in{'file'}) ||
9 &error($text{'htindex_ecannot'});
10 $hconf = &get_htaccess_config($in{'file'});
11 $d = $hconf->[$in{'idx'}];
12 &lock_file($d->{'file'});
16 # deleting a directive
17 &save_directive_struct($d, undef, $hconf, $hconf);
20 # changing a directive
22 if ($httpd_modules{'core'} >= 1.3) {
23 $d->{'name'} = 'FilesMatch';
24 $d->{'value'} = "\"$in{'path'}\"";
27 $d->{'name'} = 'Files';
28 $d->{'value'} = "~ \"$in{'path'}\"";
32 $d->{'name'} = 'Files';
33 $d->{'value'} = "\"$in{'path'}\"";
35 &save_directive_struct($d, $d, $hconf, $hconf, 1);
38 &unlock_file($d->{'file'});
41 &webmin_log("files", $in{'delete'} ? 'delete' : 'save',
42 "$in{'file'}:$d->{'words'}->[0]", \%in);
43 &redirect("htaccess_index.cgi?file=".&urlize($in{'file'}));