#!/usr/bin/perl

print "Content-Type: Text/HTML\n\n";

use CGI ':standard';
use Vpanel 1.00;
require $header;
require $accountinfo;

$domainname = find_domain ($mainuser);

# Define the tab which appears to the front
$tab_section = $tabnum_mailwall;

# Output the content associated with this tab
print "<body class=section-$tab_section>";

# display tabs
require $tabdisplay;

print_header("Removal of Virus protection for $domainname");

$virus_status = virus_scanning_status($domainname);
if ($virus_status eq "on" )
{
	print "Thank you for your request to turn off MailWall's Anti-Virus protection.";
	show_time_to_change();

	open (REMOVE, ">>$remove_virus_protection_file") || file_error($remove_virus_protection_file);
	print REMOVE $domainname, "\n";
	close (REMOVE);

	# Now amend the filetype scanning file
	
	$proceed =0;
	$filetype_scanning_status = filetype_scanning_status($domainname);
	if ( $filetype_scanning_status eq "virus_and_spam" )
	{
		$list_file_flag = "only_spam";
		$proceed = 1;
	} elsif ( $filetype_scanning_status eq "only_virus" ) {
		$list_file_flag = "nothing";
		$proceed = 1;
	}

	if ( $proceed == 1 )
	{
		# proceed with the change
		open ( CHANGE, ">>$change_filetype_scanning_file") || file_error($change_filetype_scanning_file);
		print CHANGE "$list_file_flag,$domainname\n";
		close (CHANGE);
	}
} else {
	print "Sorry, but it seems that this feature cannot be turned off at the moment.";
	print_support_contact_information();
}	

require $footer;
