#!/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);
@validusers = find_valid_users($domainname);

# 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 ("Removal of an 'Out of Office' reply for $domainname");

print "Please select the user whose 'Out of Office' reply you wish to remove:<BR>";

print "<form method=post action=/$script_bin/$confirm_delete_out_of_office class=text>";
print "<B>User:</B><BR><select name=vacationuser class=text> ";
for $validuser ( @validusers )
{
        $ftpstring = "^ftp";
	$spamstring = "^spam";
        if ( ( ! ( $validuser =~ /$ftpstring/ ) ) && ( ! ($validuser =~ /$spamstring/ ) ) )
        {
		$home_directory = find_user_home_directory($validuser);
		$vacation_file = $home_directory . "/.forward";
		if ( -e $vacation_file )
		{
			print "<option value=$validuser>$validuser";
		}
	}
}

print "</select>";

print_end_of_form();

require $footer;
