#!/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);
$chosen_user = param ('user');

@validusers = find_valid_users($domainname);
$numusers = @validusers;

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

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

# display tabs
require $tabdisplay;

print_header ("Deleting a $domainname user's mailbox");

print "
All emails you have not downloaded for a user are in that user's mailbox. If this mailbox has become
particularly large, you can empty it. Just choose the user whose mailbox you wish to delete from the list below.
Choosing this option <i>will not</i> delete the user, it will simply remove all emails from this user's account.<BR><BR>
";

print "<table width=50% class=text>";
print "<form method=post action=/$script_bin/$confirm_empty_mailbox class=text>";
print "<tr><td width=10%><B>User/Mailbox:</B></td><td><select name=mailbox class=text>";
for $validuser ( @validusers )
{
        $mainuserstring = "$mainuser";
	print "\n<option value=$validuser";
	if ( $chosen_user eq $validuser )
	{
		print " selected ";
 	}
                print ">$validuser";
}
print "</select></td></tr></table>";
$spam_trap_status = spam_actions_status($domainname);
$spam_trap_name = "spam" . $mainuser;
if ( $spam_trap_status eq "on" )
{
	print "<span class=vpanelcomments>[ Note: your spam trap is called $spam_trap_name ]</span>"; 
}

print_end_of_form();

require $footer;
