3 # Modify or delete a <Directory>, <Files> or <Location> clause
5 require './apache-lib.pl';
7 ($vconf, $v) = &get_virtual_config($in{'virt'});
8 &can_edit_virt($v) || &error($text{'virt_ecannot'});
9 $d = $vconf->[$in{'idx'}];
10 &lock_file($d->{'file'});
12 $conf = &get_config();
15 # deleting a directive
16 &save_directive_struct($d, undef, $vconf, $conf);
19 # changing a directive
20 &error_setup($text{'cdir_err2'});
21 $in{'path'} || &error($text{'cdir_epath'});
22 $in{'type'} eq 'Proxy' || $in{'type'} eq 'Location' ||
23 &allowed_doc_dir($in{'path'}) ||
24 &error($text{'cdir_ecannot'});
26 $in{'type'} eq 'Proxy' && &error($text{'cdir_eproxy'});
27 if ($httpd_modules{'core'} >= 1.3) {
28 $d->{'name'} = $in{'type'}."Match";
29 $d->{'value'} = "\"$in{'path'}\"";
32 $d->{'name'} = $in{'type'};
33 $d->{'value'} = "~ \"$in{'path'}\"";
37 $d->{'name'} = $in{'type'};
38 $d->{'value'} = "\"$in{'path'}\"";
40 &save_directive_struct($d, $d, $vconf, $conf, 1);
43 &unlock_file($d->{'file'});
46 &webmin_log("dir", $in{'delete'} ? 'delete' : 'save',
47 &virtual_name($v, 1).":".$d->{'words'}->[0], \%in);
48 &redirect("virt_index.cgi?virt=$in{'virt'}");