Handle hostnames with upper-case letters
[webmin.git] / apache / delete_vservs.cgi
1 #!/usr/local/bin/perl
2 # Delete a bunch of virtual servers
3
4 require './apache-lib.pl';
5 &ReadParse();
6 &error_setup($text{'delete_err'});
7 $access{'vaddr'} || &error($text{'delete_ecannot'});
8 $conf = &get_config();
9 @d = split(/\0/, $in{'d'});
10 @d || &error($text{'delete_enone'});
11
12 # Get them all
13 foreach $d (@d) {
14         ($vmembers, $vconf) = &get_virtual_config($d);
15         &can_edit_virt($vconf) || &error(&text('delete_ecannot2',
16                                                &virtual_name($vconf)));
17         push(@virts, $vconf);
18         }
19
20 # Delete their structures
21 &before_changing();
22 foreach $vconf (@virts) {
23         &lock_file($vconf->{'file'});
24         &save_directive_struct($vconf, undef, $conf, $conf);
25         &delete_file_if_empty($vconf->{'file'});
26         }
27 &flush_file_lines();
28 &unlock_all_files();
29 &after_changing();
30 &webmin_log("virts", "delete", scalar(@virts));
31 &redirect("");
32