3 # Create an empty <Directory>, <Files> or <Location> clause
5 require './apache-lib.pl';
7 &error_setup($text{'cdir_err'});
8 ($vconf, $v) = &get_virtual_config($in{'virt'});
9 &can_edit_virt($v) || &error($text{'virt_ecannot'});
11 &lock_file($vconf->[0]->{'file'});
15 $in{'path'} || &error($text{'cdir_epath'});
16 $in{'type'} eq 'Proxy' || $in{'type'} eq 'Location' ||
17 &allowed_doc_dir($in{'path'}) || &error($text{'cdir_ecannot'});
19 # Create the file structure
20 $dir = { 'type' => 1 };
22 $in{'type'} eq 'Proxy' && &error($text{'cdir_eproxy'});
23 if ($httpd_modules{'core'} >= 1.3) {
24 $dir->{'name'} = $in{'type'}."Match";
25 $dir->{'value'} = "\"$in{'path'}\"";
28 $dir->{'name'} = $in{'type'};
29 $dir->{'value'} = "~ \"$in{'path'}\"";
33 $dir->{'name'} = $in{'type'};
34 $dir->{'value'} = "\"$in{'path'}\"";
38 &save_directive_struct(undef, $dir, $vconf, $conf);
40 &unlock_file($vconf->[0]->{'file'});
43 &webmin_log("dir", "create", &virtual_name($v, 1).":$in{'path'}", \%in);
44 &redirect("virt_index.cgi?virt=$in{'virt'}");