MOON
Server: Apache
System: Linux cl1170g 4.19.62-mod-std-ipv6-64-rescue #828825 SMP Tue Jul 30 13:54:49 UTC 2019 x86_64
User: wh0f20bb (1057)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //proc/thread-self/root/root/webmin-1.881/apache/delete_vservs.cgi
#!/usr/bin/perl
# Delete a bunch of virtual servers

require './apache-lib.pl';
&ReadParse();
&error_setup($text{'delete_err'});
$access{'vaddr'} || &error($text{'delete_ecannot'});
$conf = &get_config();
@d = split(/\0/, $in{'d'});
@d || &error($text{'delete_enone'});

# Get them all
foreach $d (@d) {
	($vmembers, $vconf) = &get_virtual_config($d);
	&can_edit_virt($vconf) || &error(&text('delete_ecannot2',
					       &virtual_name($vconf)));
	push(@virts, $vconf);
	}

# Delete their structures
&before_changing();
foreach $vconf (@virts) {
	&lock_file($vconf->{'file'});
	&save_directive_struct($vconf, undef, $conf, $conf);
	&delete_file_if_empty($vconf->{'file'});
	}
&flush_file_lines();
&unlock_all_files();
&after_changing();
&webmin_log("virts", "delete", scalar(@virts));
&redirect("");