#!/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);
$hostingplan = find_hosting_plan ($domainname);

# 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("Turning off content management for $domainname");

print qq!

Thank you for your request to turn off this feature.

!;

$content_management_status = content_management_scanning_status($domainname);

if ( $content_management_status eq "on" )
{
	# Turn off content management
	open ( TURNON, ">>$remove_content_management_file" ) || file_error($create_content_management_file);
	print TURNON "$domainname\n";
	close (TURNON);

	# Turn off images scanning if it's turned on
	$make_filetype_change = 0;
	$filetype_scanning_status = filetype_scanning_status($domainname);
	if ( $filetype_scanning_status eq "everything" )
	{
		$list_file_flag = "only_virus";
		$make_filetype_change = 1;
	} elsif ( $filetype_scanning_status eq "only_spam" ) {
		$list_file_flag = "nothing";
		$make_filetype_change = 1;
	}

	if ( $make_filetype_change == 1 )
	{
		open ( CHANGE, ">>$change_filetype_scanning_file") || file_error($change_filetype_scanning_file);
		print CHANGE "$list_file_flag,$domainname\n";
		close (CHANGE);
	}

	show_time_to_change();
} else {
	print "However, it seems that this feature is already turned off or is waiting to be turned off.";
	print_support_contact_information();	
}
require $footer;
