<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
require_once ( "../includes/ta_vpopmail.inc" );
$vpop = new TA_Vpopmail;
switch ( $_POST["submit"] )
{
case "Add Domain":
$password = $_POST["password"];
$verify_password = $_POST["verify_password"];
$domain = $_POST["domain"];
if ( ( $password != $verify_password ) || ( $password == "" ) )
{
echo ( "<br/>Password Do Not Match<br/><br/>" );
echo ( "Password: $password<br/>" );
echo ( "Verify Password: $verify_password<br/>" );
die ();
}
$ret = $vpop->add_domain ( $domain, $password );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/>Domain $domain Added<br/>" );
}
break;
case "Add User":
$password = $_POST["password"];
$verify_password = $_POST["verify_password"];
$email_address = $_POST["email_address"];
if ( ( $password != $verify_password ) || ( $password == "" ) )
{
echo ( "<br/>Password Do Not Match<br/><br/>" );
echo ( "Password: $password<br/>" );
echo ( "Verify Password: $verify_password<br/>" );
die ();
}
$ret = $vpop->add_user ( $email_address, $password );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/>User $email_address Added<br/>" );
}
break;
case "Change Password":
$email_address = $_POST [ "email_address" ];
$password = $_POST [ "password" ];
$verify_password = $_POST [ "verify_password" ];
if ( ( $password != $verify_password ) || ( $password == "" ) )
{
echo ( "<br/>Password Do Not Match<br/><br/>" );
echo ( "Password: $password<br/>" );
echo ( "Verify Password: $verify_password<br/>" );
die ();
}
$ret = $vpop->change_password ( $email_address, $password );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/>Password for $email_address changed to $password<br/>" );
}
break;
case "Delete Domain":
$ret = $vpop->delete_domain ( $domain );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/>Domain $domain Deleted<br/>" );
}
break;
case "Delete User":
$email_address = $_POST [ "email_address" ];
$ret = $vpop->delete_user ( $email_address );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/> Deleted $email_address<br/>" );
}
break;
case "All Information":
$email_address = $_POST [ "email_address" ];
$ret = $vpop->user_info ( $email_address );
$line_count = count ( $vpop->vpopmail_parsed_return );
for ( $i = 0; $i < $line_count; $i++ )
{
echo ( $vpop->vpopmail_parsed_return [ $i ] ."<br/>" );
}
break;
case "Get Password":
$email_address = $_POST [ "email_address" ];
$ret = $vpop->get_password ( $email_address );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/> User: $email_address<br/>" );
echo ( "Password: " .$vpop->vpopmail_return );
}
break;
case "Get Addresses":
$domain = $_POST [ "domain" ];
$ret = $vpop->get_email_addresses ( $domain );
$line_count = count ( $vpop->vpopmail_parsed_return );
asort ( $vpop->vpopmail_parsed_return );
reset ( $vpop->vpopmail_parsed_return );
array_walk ( $vpop->vpopmail_parsed_return, "print_array" );
break;
case "Set Quota":
$email_address = $_POST [ "email_address" ];
$quota = $_POST [ "quota" ];
$ret = $vpop->set_user_quota ( $email_address, $quota );
if ( $ret != 0 )
{
echo ( $vpop->vpopmail_return ."<br/>" );
}else{
echo ( "<br/> User: $email_address<br/>" );
echo ( "Quota: $quota" );
}
break;
case "Quota Used":
$email_address = $_POST [ "email_address" ];
$ret = $vpop->user_info ( $email_address, "-Q" );
$line_count = count ( $vpop->vpopmail_parsed_return );
echo ( $email_address ."<br/>" );
echo ( $vpop->vpopmail_return ."<br/>" );
break;
default:
break;
}
function print_array ( $item, $key )
{
echo ( $item ."<br/>" );
}
?>
</body>
</html>
|