Location: PHPKode > projects > XMail PHP Admin Interface (XPAI) > xpai/includes/custdomdel.php
<?php
if (!$in_xpai)
  die;

if (($_SESSION['loginstatus'] == $login_level['LoginSuperuser']) && ($_REQUEST['sel_domain'] != "*"))
{
  echo "<h1><a href=\"javascript:help('xpai_help.html#custdomdel','".$helpwidth."','".$helpheight."')\"><img src='gfx/ico_help.png' alt='Help' border='0'></a>&nbsp;&nbsp;";
  echo "Delete mail domain <span class=\"blue\">".$_REQUEST['sel_domain']."</span></h1>";

  $multi_success = true;
 	$restore_secondaries = false;
	if (isset($handle_secondaries) && $handle_secondaries)
	{
 		$custdom_data = $mail_server->custdomget($_REQUEST['sel_domain']);
 	 	foreach ($_SESSION['secondary-ip'] as $secondary)
	 	{
  		if (!$mail_server->custdomset($_REQUEST['sel_domain'], "", $secondary['ip'], $secondary['port']))
 		 	{
		    $multi_success = false;
 			  $restore_secondaries = true;
				$secondary_error_source = $secondary['ip']." ".$secondary['port'];
        echo "Error deleting custom domain <strong>".$_REQUEST['custdom_name']."</strong> from secondary ".$secondary['ip'].".<br>";
 			  break;
		  } else {
        echo "Deleted custom domain <strong>".$_REQUEST['custdom_name']."</strong> from secondary ".$secondary['ip'].".<br>";
			} 
	  }
		echo "<br>";
  } 
  if ($multi_success)
  {
 		if ($mail_server->custdomset($_REQUEST['sel_domain'], ""))
    {
      echo "Custom domain <strong>".$_REQUEST['sel_domain']."</strong> was deleted successfully.<br>";
      echo "Server result: ".$_SESSION['LastXMAILResult']."<br><br>";
    } else {
	    $restore_secondaries = true;
      echo "Could not delete custom domain <strong>".$_REQUEST['sel_domain']."</strong>.<br>";
      echo "Server result: ".$_SESSION['LastXMAILResult']."<br><br>";
    }
  }
  if (isset($handle_secondaries) && $handle_secondaries && $restore_secondaries)
	{
 	  foreach ($_SESSION['secondary-ip'] as $secondary)
	  {
	 	 	$mail_server->custdomset($_REQUEST['sel_domain'], $custdom_data[0][0]."\t".$custdom_data[0][1], $secondary['ip'], $secondary['port']);
	  }
	}

  if (isset($handle_secondaries) && $handle_secondaries && !$multi_success)
  {
    echo "Could not delete custom domain <strong>".$_REQUEST['sel_domain']."</strong>.<br>";
    echo "Error on secondary server <strong>".$secondary_error_source."</strong><br><br>";
	} 
?>
	<form action='main.php' method='get'>
		<input type='hidden' name='action' value='domainlist'>
		<input type='submit' name='click' style='width: 50px;' value=' OK '>
	</form>
<?php
} else {
  echo "<br><br><h2>Authorization failed to access this function!</h2><br><br>";
}
?>

Return current item: XMail PHP Admin Interface (XPAI)