add_zone_master.php
changeset 79 0c0aa144356a
parent 71 e1b918eaf69a
child 82 c255196bc447
equal deleted inserted replaced
78:effde559e0e9 79:0c0aa144356a
    25 {
    25 {
    26         error(ERR_LEVEL_5);
    26         error(ERR_LEVEL_5);
    27 
    27 
    28 }
    28 }
    29 
    29 
    30 if ($_POST["submit"])
    30 if (isset($_POST["submit"]))
    31 {
    31 {
    32         $domain = trim($_POST["domain"]);
    32         $domain = (isset($_POST['domain']) ? trim($_POST["domain"]) : '');
    33         $owner = $_POST["owner"];
    33         $owner = (isset($_POST['owner']) ? $_POST["owner"] : 0 );
    34         $webip = $_POST["webip"];
    34         $webip = (isset($_POST["webip"]) ? $_POST['webip'] : '');
    35         $mailip = $_POST["mailip"];
    35         $mailip = (isset($_POST["mailip"]) ? $_POST['mailip'] : '');
    36         $empty = $_POST["empty"];
    36         $empty = (isset($_POST["empty"]) ? $_POST['empty'] : 0);
    37         $dom_type = isset($_POST["dom_type"]) ? $_POST["dom_type"] : "NATIVE";
    37         $dom_type = (isset($_POST["dom_type"]) ? $_POST["dom_type"] : "NATIVE");
    38         if(!$empty)
    38         if(!$empty)
    39         {
    39         {
    40                 $empty = 0;
    40                 $empty = 0;
    41                 if(!eregi('in-addr.arpa', $domain) && (!is_valid_ip($webip) || !is_valid_ip($mailip)) )
    41                 if(!eregi('in-addr.arpa', $domain) && (!is_valid_ip($webip) || !is_valid_ip($mailip)) )
    42                 {
    42                 {
    43                         $error = "Web or Mail ip is invalid!";
    43                         $error = "Web or Mail ip is invalid!";
    44                 }
    44                 }
    45         }
    45         }
    46         if (!$error)
    46         if (!isset($error))
    47         {
    47         {
    48                 if (!is_valid_domain($domain))
    48                 if (!is_valid_domain($domain))
    49                 {
    49                 {
    50                         $error = "Zone name is invalid!";
    50                         $error = "Zone name is invalid!";
    51                 }
    51                 }
    62         }
    62         }
    63 }
    63 }
    64 
    64 
    65 include_once("inc/header.inc.php");
    65 include_once("inc/header.inc.php");
    66 
    66 
    67 	if ($error != "")
    67 	if ((isset($error)) && ($error != ""))
    68 	{
    68 	{
    69 	        ?><div class="error"><?php echo _('Error'); ?>: <?php echo $error; ?></div><?php
    69 	        ?><div class="error"><?php echo _('Error'); ?>: <?php echo $error; ?></div><?php
    70 	}
    70 	}
    71 	elseif ($success != "")
    71 	elseif ((isset($success)) && ($success != ""))
    72 	{
    72 	{
    73 		?><div class="success"><?php echo $success; ?></div><?php
    73 		?><div class="success"><?php echo $success; ?></div><?php
    74 	}
    74 	}
    75 
    75 
    76 	?>
    76 	?>
    85         <form method="post" action="add_zone_master.php">
    85         <form method="post" action="add_zone_master.php">
    86          <table>
    86          <table>
    87           <tr>
    87           <tr>
    88            <td class="n"><?php echo _('Zone name'); ?>:</td>
    88            <td class="n"><?php echo _('Zone name'); ?>:</td>
    89            <td class="n">
    89            <td class="n">
    90             <input type="text" class="input" name="domain" value="<?php if ($error) print $_POST["domain"]; ?>">
    90             <input type="text" class="input" name="domain" value="<?php if (isset($error)) print $_POST["domain"]; ?>">
    91            </td>
    91            </td>
    92           </tr>
    92           </tr>
    93           <tr>
    93           <tr>
    94            <td class="n"><?php echo _('Web IP'); ?>:</td>
    94            <td class="n"><?php echo _('Web IP'); ?>:</td>
    95            <td class="n">
    95            <td class="n">
    96             <input type="text" class="input" name="webip" value="<?php if ($error) print $_POST["webip"]; ?>">
    96             <input type="text" class="input" name="webip" value="<?php if (isset($error)) print $_POST["webip"]; ?>">
    97            </td>
    97            </td>
    98           </tr>
    98           </tr>
    99           <tr>
    99           <tr>
   100            <td class="n"><?php echo _('Mail IP'); ?>:</TD>
   100            <td class="n"><?php echo _('Mail IP'); ?>:</TD>
   101            <td class="n">
   101            <td class="n">
   102             <input type="text" class="input" name="mailip" value="<?php if ($error) print $_POST["mailip"]; ?>">
   102             <input type="text" class="input" name="mailip" value="<?php if (isset($error)) print $_POST["mailip"]; ?>">
   103            </td>
   103            </td>
   104           </tr>
   104           </tr>
   105           <tr>
   105           <tr>
   106            <td class="n"><?php echo _('Owner'); ?>:</td>
   106            <td class="n"><?php echo _('Owner'); ?>:</td>
   107            <td class="n">
   107            <td class="n">