add_zone_master.php
changeset 110 455405c757e1
parent 82 c255196bc447
child 111 0a2342a64b83
equal deleted inserted replaced
109:34b2d49f52c6 110:455405c757e1
    48 	// 20080303/RZ
    48 	// 20080303/RZ
    49 
    49 
    50         if(!$empty) {
    50         if(!$empty) {
    51                 $empty = 0;
    51                 $empty = 0;
    52                 if(!eregi('in-addr.arpa', $domain) && (!is_valid_ip($webip) || !is_valid_ip($mailip)) ) {
    52                 if(!eregi('in-addr.arpa', $domain) && (!is_valid_ip($webip) || !is_valid_ip($mailip)) ) {
    53                         error(_('Web or mail ip is invalid!')); 
    53                         error(_('IP address of web- or mailserver is invalid.')); 
    54 			$error = "1";
    54 			$error = "1";
    55                 }
    55                 }
    56         }
    56         }
    57 
    57 
    58         if (!$error) {
    58         if (!$error) {
    59                 if (!is_valid_domain($domain)) {
    59                 if (!is_valid_domain($domain)) {
    60                         error(_('Zone name is invalid!')); 
    60                         error(ERR_DOMAIN_INVALID); 
    61 			$error = "1";
    61 			$error = "1";
    62                 } elseif (domain_exists($domain)) {
    62                 } elseif (domain_exists($domain)) {
    63                         error(_('Zone already exists!!')); 
    63                         error(ERR_DOMAIN_EXISTS); 
    64 			$error = "1";
    64 			$error = "1";
    65                 } else {
    65                 } else {
    66                         if (add_domain($domain, $owner, $webip, $mailip, $empty, $dom_type, '')) {
    66                         if (add_domain($domain, $owner, $webip, $mailip, $empty, $dom_type, '')) {
    67 				success(SUC_ZONE_ADD);
    67 				success(SUC_ZONE_ADD);
    68 				unset($domain, $owner, $webip, $mailip, $empty, $dom_type);
    68 				unset($domain, $owner, $webip, $mailip, $empty, $dom_type);
    71 			}
    71 			}
    72                 }
    72                 }
    73         }
    73         }
    74 }
    74 }
    75 
    75 
    76 echo "     <h2>" . _('Add master zone') . "</h2>\n"; 
    76 if ( $zone_master_add != "1" ) {
       
    77 	error(ERR_PERM_ADD_ZONE_MASTER); 
       
    78 } else {
       
    79 	echo "     <h2>" . _('Add master zone') . "</h2>\n"; 
    77 
    80 
    78 if ( $zone_master_add != "1" ) {
       
    79 	echo "     <p>" . _("You do not have the permission to add a new master zone.") . "</p>\n"; 
       
    80 } else {
       
    81 	$available_zone_types = array("MASTER", "NATIVE");
    81 	$available_zone_types = array("MASTER", "NATIVE");
    82 	$users = show_users();
    82 	$users = show_users();
    83 
    83 
    84 	echo "     <form method=\"post\" action=\"add_zone_master.php\">\n";
    84 	echo "     <form method=\"post\" action=\"add_zone_master.php\">\n";
    85 	echo "      <table>\n";
    85 	echo "      <table>\n";
    88 	echo "        <td class=\"n\">\n";
    88 	echo "        <td class=\"n\">\n";
    89 	echo "         <input type=\"text\" class=\"input\" name=\"domain\" value=\"" .  $domain . "\">\n";
    89 	echo "         <input type=\"text\" class=\"input\" name=\"domain\" value=\"" .  $domain . "\">\n";
    90 	echo "        </td>\n";
    90 	echo "        </td>\n";
    91 	echo "       </tr>\n";
    91 	echo "       </tr>\n";
    92 	echo "       <tr>\n";
    92 	echo "       <tr>\n";
    93 	echo "        <td class=\"n\">" . _('Web IP') . ":</td>\n";
    93 	echo "        <td class=\"n\">" . _('IP address of webserver') . ":</td>\n";
    94 	echo "        <td class=\"n\">\n";
    94 	echo "        <td class=\"n\">\n";
    95 	echo "         <input type=\"text\" class=\"input\" name=\"webip\" value=\"" . $webip . "\">\n";
    95 	echo "         <input type=\"text\" class=\"input\" name=\"webip\" value=\"" . $webip . "\">\n";
    96 	echo "        </td>\n";
    96 	echo "        </td>\n";
    97 	echo "       </tr>\n";
    97 	echo "       </tr>\n";
    98 	echo "       <tr>\n";
    98 	echo "       <tr>\n";
    99 	echo "        <td class=\"n\">" . _('Mail IP') . ":</td>\n";
    99 	echo "        <td class=\"n\">" . _('IP address of mailserver') . ":</td>\n";
   100 	echo "        <td class=\"n\">\n";
   100 	echo "        <td class=\"n\">\n";
   101 	echo "         <input type=\"text\" class=\"input\" name=\"mailip\" value=\"" . $mailip . "\">\n";
   101 	echo "         <input type=\"text\" class=\"input\" name=\"mailip\" value=\"" . $mailip . "\">\n";
   102 	echo "        </td>\n";
   102 	echo "        </td>\n";
   103 	echo "       </tr>\n";
   103 	echo "       </tr>\n";
   104 	echo "       <tr>\n";
   104 	echo "       <tr>\n";