edit.php
changeset 38 cf767482333a
parent 37 b785e54690ce
child 41 48f2ac49ec24
equal deleted inserted replaced
37:b785e54690ce 38:cf767482333a
    28 {
    28 {
    29 	delete_owner($_GET["id"], $_POST["del_user"]);
    29 	delete_owner($_GET["id"], $_POST["del_user"]);
    30 }
    30 }
    31 $info = get_domain_info_from_id($_GET["id"]);
    31 $info = get_domain_info_from_id($_GET["id"]);
    32 include_once("inc/header.inc.php");
    32 include_once("inc/header.inc.php");
    33 
    33 	
    34 if (level(5))
    34 $domain_type=get_domain_type($_GET['id']);
    35 {
    35 if ($domain_type == "SLAVE" ) { $slave_master=get_domain_slave_master($_GET['id']); };
    36 	if(!isset($info["ownerid"]))
    36 
    37 	{
    37 if(!isset($info["ownerid"]) && $domain_type != "SLAVE")
    38 	?>
    38 {
    39 	    <div class="error"><? echo _('Error'); ?>: <? echo ('There is no owner for this zone, please assign someone.'); ?></div>
    39 ?>
    40 	<?
    40     <div class="error"><? echo _('Error'); ?>: <? echo ('There is no owner for this zone, please assign someone.'); ?></div>
    41 	}
    41 <?
    42 	$domain_type=get_domain_type($_GET['id']);
    42 }
    43 	if ($domain_type == "SLAVE" )
    43 if ($domain_type == "SLAVE" && $slave_master )
    44 	{
    44 {
    45 		$slave_master=get_domain_slave_master($_GET['id']);
    45 ?>
    46 		if ($slave_master == "" )
    46     <div class="error"><? echo _('Error'); ?>: <? echo _('Type of this zone is "slave", but there is no IP address for it\'s master given.'); ?></div>
    47 		{
    47 <?
    48 ?>
    48 }
    49             <div class="error"><? echo _('Type of this zone is "slave", but there is no IP address for it\'s master given.'); ?></div>
       
    50 <?
       
    51 		}
       
    52 	}
       
    53 }
       
    54 
       
    55 ?>
    49 ?>
    56     <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
    50     <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
    57 <?
    51 <?
    58 
       
    59 if (level(5)) 
    52 if (level(5)) 
    60 { ?>	
    53 { ?>	
    61        <div id="meta">
    54        <div id="meta">
    62         <div id="meta-left">
    55         <div id="meta-left">
    63 	 <table>
    56 	 <table>
   118             </td>
   111             </td>
   119   	   </form>
   112   	   </form>
   120   	  </tr>
   113   	  </tr>
   121          </table>
   114          </table>
   122 	</div> <? // eo div meta-left ?>
   115 	</div> <? // eo div meta-left ?>
   123  
       
   124 <?
       
   125 	$domain_type=get_domain_type($_GET['id']);
       
   126 ?>
       
   127         <div id="meta-right">
   116         <div id="meta-right">
   128          <table>
   117          <table>
   129 	  <tr>
   118 	  <tr>
   130 	   <th colspan="2"><? echo _('Type of zone'); ?></th>
   119 	   <th colspan="2"><? echo _('Type of zone'); ?></th>
   131 	  </tr>
   120 	  </tr>
   175             </td>
   164             </td>
   176            </tr>
   165            </tr>
   177           </form>
   166           </form>
   178 <?
   167 <?
   179 	}
   168 	}
   180 }
       
   181 ?>
   169 ?>
   182          </table>  
   170          </table>  
   183         </div> <? // eo div meta-right ?>
   171         </div> <? // eo div meta-right ?>
   184        </div> <? // eo div meta ?>
   172        </div> <? // eo div meta 
       
   173 }
       
   174 else
       
   175 {
       
   176 ?>
       
   177        <div id="meta">
       
   178         <div id="meta-right">
       
   179          <table>
       
   180  	  <tr>
       
   181  	   <th><? echo _('Type of zone'); ?></th><td class="y"><? echo $domain_type; ?></td>
       
   182 	  </tr>
       
   183 <?
       
   184 	if ($domain_type == "SLAVE" &&  $slave_master )
       
   185 	{
       
   186 ?>
       
   187 	  <tr>
       
   188 	   <th><? echo _('IP address of master NS'); ?></th><td class="y"><? echo $slave_master; ?></td>
       
   189 	  </tr>
       
   190 <?
       
   191 	}
       
   192 ?>
       
   193          </table>
       
   194         </div> <? //eo div meta-right ?>
       
   195         </div> <? // eo div meta
       
   196 }
       
   197 ?>
   185        <div id="meta">
   198        <div id="meta">
   186 <?
   199 <?
   187 	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
   200 	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
   188 	{
   201 	{
   189 ?>
   202 ?>
   237 		if ($domain_type != "SLAVE" )
   250 		if ($domain_type != "SLAVE" )
   238 		{	
   251 		{	
   239 			if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
   252 			if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
   240 			{
   253 			{
   241 ?>
   254 ?>
   242              <a href="edit_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]"></a>
   255 			     <a href="edit_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]"></a>
   243              <a href="delete_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/delete.gif" ALT="[ <? echo _('Delete record'); ?> ]" BORDER="0"></a>
   256 			     <a href="delete_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/delete.gif" ALT="[ <? echo _('Delete record'); ?> ]" BORDER="0"></a>
   244 <?
   257 <?
   245 			}
   258 			}
   246 		}
   259 		}
   247 		if(level(10) && $domain_type != "SLAVE") 
   260 		if(level(10) && $domain_type != "SLAVE") 
   248 		{ 
   261 		{ 
   249 ?>
   262 ?>
   250 	     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
   263 		     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
   251 <? 
   264 <? 
   252 		}
   265 		}
   253 ?>
   266 ?>
   254             </td>
   267             </td>
   255 <? 
   268 <?