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

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

  if (!isset($_REQUEST['Go']))
  {
  	$multi_success = true;
   	$restore_secondaries = false;
  	if (isset($handle_secondaries) && $handle_secondaries)
   	{
   	 	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 domain alias <b>".$domainname."</b> from secondary ".$secondary['ip'].".<br>";
  			  break;
  		  } else {
          echo "Deleted domain alias <b>".$domainname."</b> from secondary ".$secondary['ip'].".<br>";
				}
  	  }
  		echo "<br>";
   	} 

		if ($multi_success)
		{
			if ($mail_server->aliasdomaindel($_REQUEST['sel_domain']))
      {
				echo "Domain alias <b>".$_REQUEST['sel_domain']."</b> was deleted successfully.<br>";
        echo "Server result: ".$_SESSION['LastXMAILResult']."<br>";
			} else {
				echo "Domain alias <b>".$_REQUEST['sel_domain']."</b> could not be deleted.<br>";
        echo "Server result: ".$_SESSION['LastXMAILResult']."<br>";
 			  $restore_secondaries = true;
      }
	  }
  	if (isset($handle_secondaries) && $handle_secondaries && $restore_secondaries)
 		{
   	  foreach ($_SESSION['secondary-ip'] as $secondary)
  	  {
  		 	$mail_server->custdomset($_REQUEST['sel_domain'], $_SESSION['secondary-mode']."\t".$_SESSION['secondary-dest'], $secondary['ip'], $secondary['port']);
  	  }
    } 
    if (isset($handle_secondaries) && $handle_secondaries && !$multi_success)
    {
			echo "Domain alias <b>".$_REQUEST['sel_domain']."</b> could not be deleted.<br>";
      echo "Error on secondary server <strong>".$secondary_error_source."</strong><br>";
  	} 
?>
  	<form action='main.php' method='get'>
  		<input type='hidden' name='action' value='aliasdomainlist'>
		  <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)