edit.php
changeset 13 2ff220cfde13
parent 5 ebf8868e99f5
child 37 b785e54690ce
equal deleted inserted replaced
12:7be4525290cc 13:2ff220cfde13
     1 <?php
     1 <?php
     2 
     2 
     3 // +--------------------------------------------------------------------+
       
     4 // | PowerAdmin								|
       
     5 // +--------------------------------------------------------------------+
       
     6 // | Copyright (c) 1997-2002 The PowerAdmin Team			|
       
     7 // +--------------------------------------------------------------------+
       
     8 // | This source file is subject to the license carried by the overal	|
       
     9 // | program PowerAdmin as found on http://poweradmin.sf.net		|
       
    10 // | The PowerAdmin program falls under the QPL License:		|
       
    11 // | http://www.trolltech.com/developer/licensing/qpl.html		|
       
    12 // +--------------------------------------------------------------------+
       
    13 // | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl>	|
       
    14 // |          Sjeemz <sjeemz <AT> sjeemz <DOT> nl>			|
       
    15 // +--------------------------------------------------------------------+
       
    16 
       
    17 //
       
    18 // $Id: edit.php,v 1.12 2003/05/10 20:10:47 azurazu Exp $
       
    19 //
       
    20 
       
    21 require_once("inc/toolkit.inc.php");
     3 require_once("inc/toolkit.inc.php");
    22 
     4 
    23 // Assigning records to user: Check for records owned by user
     5 // Assigning records to user: Check for records owned by user
    24 
     6 
    25 if (isset($_POST["action"]) && $_POST["action"]=="record-user") {
     7 if (isset($_POST["action"]) && $_POST["action"]=="record-user") {
    26    foreach ($_POST["rowid"] as $x_user => $x_value){
     8 	foreach ($_POST["rowid"] as $x_user => $x_value){
    27       $x_userid = $db->getOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$x_value."'");
     9 		$x_userid = $db->queryOne("SELECT id FROM record_owners WHERE user_id = '".$_POST["userid"]."' AND record_id='".$x_value."'");
    28       if (empty($x_userid)) {
    10 		if (empty($x_userid)) {
    29          $db->query("INSERT INTO record_owners SET user_id = '".$_POST["userid"]."',record_id='".$x_value."'");
    11 			$db->query("INSERT INTO record_owners SET user_id = '".$_POST["userid"]."',record_id='".$x_value."'");
    30       }
    12 		}
    31    }
    13 	}
    32 }
    14 }
    33 
    15 if(isset($_POST['change_slave_master']) && is_numeric($_POST["domain"]) && level(5))
    34 $server_types = array("MASTER", "SLAVE", "NATIVE");
    16 {
    35 
    17 	change_domain_slave_master($_POST['domain'], $_POST['slave_master']);
       
    18 }
    36 if(isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types))
    19 if(isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types))
    37 {
    20 {
    38     change_domain_type($_POST['newtype'], $_GET['id']);
    21 	change_domain_type($_POST['newtype'], $_GET['id']);
    39 }
    22 }
    40 if(isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"]))
    23 if(isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"]))
    41 {
    24 {
    42 	add_owner($_POST["domain"], $_POST["newowner"]);
    25 	add_owner($_POST["domain"], $_POST["newowner"]);
    43 }
    26 }
    44 
       
    45 if(isset($_POST["del_user"]) && is_numeric($_POST["del_user"]) && level(5))
    27 if(isset($_POST["del_user"]) && is_numeric($_POST["del_user"]) && level(5))
    46 {
    28 {
    47 	delete_owner($_GET["id"], $_POST["del_user"]);
    29 	delete_owner($_GET["id"], $_POST["del_user"]);
    48 }
    30 }
    49 
    31 $info = get_domain_info_from_id($_GET["id"]);
    50 include_once("inc/header.inc.php");
    32 include_once("inc/header.inc.php");
    51 ?>
    33 
    52 <H2><? echo _('Edit domain'); ?> "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2>
    34 if (level(5))
    53 <?
    35 {
    54 $info = get_domain_info_from_id($_GET["id"]);
    36 	if(!isset($info["ownerid"]))
    55 if(!isset($info["ownerid"]))
    37 	{
    56 {
       
    57 	?>
    38 	?>
    58 	<P CLASS="warning"><? echo _('This domain isn\'t owned by anyone yet, please assign someone.'); ?></P>
    39 	    <div class="error"><? echo _('Error'); ?>: <? echo ('There is no owner for this zone, please assign someone.'); ?></div>
    59 	<?
    40 	<?
    60 }
    41 	}
    61 ?>
    42 	$domain_type=get_domain_type($_GET['id']);
    62 
    43 	if ($domain_type == "SLAVE" )
    63 <TABLE class="text" cellspacing="0" style="width: 280px">
    44 	{
    64 <? if (level(5)) 
    45 		$slave_master=get_domain_slave_master($_GET['id']);
       
    46 		if ($slave_master == "" )
       
    47 		{
       
    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 ?>
       
    56     <h2><? echo _('Edit zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</h2>
       
    57 <?
       
    58 
       
    59 if (level(5)) 
    65 { ?>	
    60 { ?>	
    66 	<TR>
    61        <div id="meta">
    67 		<FORM METHOD="post" ACTION="edit.php?id=<?=$_GET['id']?>">
    62         <div id="meta-left">
    68 		<TD CLASS="none" VALIGN="middle" style="width: 250px;">
    63 	 <table>
    69 			<B><? echo _('Add an owner'); ?>:</B>
    64    	  <tr>
    70 			<INPUT TYPE="hidden" NAME="domain" VALUE="<?= $_GET["id"] ?>">
    65   	   <th colspan="2"><? echo _('Owner of zone'); ?></th>
    71 			<SELECT NAME="newowner">
    66   	  </tr>
    72 			<?
    67 <?
    73 			$users = show_users();
    68 	if(isset($info["ownerid"]))
    74 			foreach ($users as $u)
    69 	{
       
    70 		$userRes = get_users_from_domain_id($_GET["id"]);
       
    71 		foreach($userRes as $user)
       
    72 		{ ?>
       
    73   	  <tr>
       
    74   	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
       
    75   	    <td>
       
    76 	     <? echo $user["fullname"]?>
       
    77 	    </td>
       
    78             <td>
       
    79   	     <input type="hidden" name="del_user" value="<? echo $user["id"]?>">
       
    80              <input type="submit" class="sbutton" name="co" value="<? echo _('Delete'); ?>">
       
    81   	    </td>
       
    82            </form>
       
    83   	  </tr>
       
    84 <?
       
    85 		}
       
    86 	}
       
    87 	else
       
    88 	{
       
    89 ?>
       
    90 	  <tr>
       
    91 	   <td><? echo _('No owner set or this zone!'); ?></td>
       
    92 	  </tr>
       
    93 <?
       
    94 	}
       
    95 }
       
    96   ?>
       
    97           <tr>
       
    98   	   <form method="post" action="edit.php?id=<? echo $_GET['id']?>">
       
    99   	    <td>
       
   100   	     <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
       
   101   	     <select name="newowner">
       
   102   			<?
       
   103   			$users = show_users();
       
   104   			foreach ($users as $u)
       
   105   			{
       
   106   				unset($add);
       
   107   				if ($u["id"] == $info["ownerid"])
       
   108   				{
       
   109   					$add = " SELECTED";
       
   110   				}
       
   111   				?>
       
   112   				<option<? echo $add ?> value="<? echo $u["id"] ?>"><? echo $u["fullname"] ?></option><?
       
   113   			}
       
   114   			?>
       
   115   			</select>
       
   116   	    </td>
       
   117   	    <td>
       
   118      	     <input type="submit" class="sbutton" name="co" value="<? echo _('Add'); ?>">
       
   119             </td>
       
   120   	   </form>
       
   121   	  </tr>
       
   122          </table>
       
   123 	</div> <? // eo div meta-left ?>
       
   124  
       
   125 <?
       
   126 if (level(5))
       
   127 {
       
   128 	$domain_type=get_domain_type($_GET['id']);
       
   129 ?>
       
   130         <div id="meta-right">
       
   131          <table>
       
   132 	  <tr>
       
   133 	   <th colspan="2"><? echo _('Type of zone'); ?></th>
       
   134 	  </tr>
       
   135 	  <form action="<? echo $_SERVER['PHP_SELF']?>?id=<? echo $_GET['id']?>" method="post">
       
   136 	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
       
   137 	   <tr>
       
   138 	    <td>
       
   139 	     <select name="newtype">
       
   140 <?
       
   141 	foreach($server_types as $s)
       
   142 	{
       
   143 		unset($add);
       
   144 		if ($s == $domain_type)
       
   145 		{
       
   146 			$add = " SELECTED";
       
   147 		}
       
   148 ?>
       
   149               <option<? echo $add ?> value="<? echo $s?>"><? echo $s?></option><?
       
   150 	}
       
   151 ?>
       
   152              </select>
       
   153             </td>
       
   154 	    <td>
       
   155 	     <input type="submit" class="sbutton" name="type_change" value="<? echo _('Change'); ?>">
       
   156 	    </td>
       
   157 	   </tr>
       
   158 	  </form>
       
   159 
       
   160 <?
       
   161 	if ($domain_type == "SLAVE" ) 
       
   162 	{ 
       
   163 		$slave_master=get_domain_slave_master($_GET['id']);
       
   164 ?>
       
   165           <tr>
       
   166 	   <th colspan="2">
       
   167 	    <? echo _('IP address of master NS'); ?>
       
   168 	   </th>
       
   169 	  </tr>
       
   170 	  <form action="<? echo $_SERVER['PHP_SELF']?>?&amp;id=<? echo $_GET['id']?>" method="post">
       
   171 	   <input type="hidden" name="domain" value="<? echo $_GET["id"] ?>">
       
   172 	   <tr>
       
   173 	    <td>
       
   174 	     <input type="text" name="slave_master" value="<? echo $slave_master; ?>" class="input">
       
   175             </td>
       
   176             <td>
       
   177 	     <input type="submit" class="sbutton" name="change_slave_master" value="<? echo _('Change'); ?>">
       
   178             </td>
       
   179            </tr>
       
   180           </form>
       
   181 <?
       
   182 	}
       
   183 }
       
   184 ?>
       
   185          </table>  
       
   186         </div> <? // eo div meta-right ?>
       
   187        </div> <? // eo div meta ?>
       
   188        <div id="meta">
       
   189 <?
       
   190 	if ($_SESSION[$_GET["id"]."_ispartial"] != 1 && $domain_type != "SLAVE" )
       
   191 	{
       
   192 ?>
       
   193         <input type="button" class="button" OnClick="location.href='add_record.php?id=<? echo $_GET["id"] ?>'" value="<? echo _('Add record'); ?>">&nbsp;&nbsp;
       
   194 <?
       
   195 	}
       
   196 	if (level(5))
       
   197 	{
       
   198 ?>
       
   199 	<input type="button" class="button" OnClick="location.href='delete_domain.php?id=<? echo $_GET["id"] ?>'" value="<? echo _('Delete zone'); ?>">
       
   200 <?
       
   201 	}
       
   202 ?>
       
   203         </div> <? // eo div meta ?>
       
   204        <div class="showmax">
       
   205 <?
       
   206 show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
       
   207 ?>
       
   208         </div> <? // eo div showmax ?>
       
   209          <form action="<? echo $_SERVER["PHP_SELF"]?>?id=<? echo $_GET["id"]?>" method="post">
       
   210           <input type="hidden" name="action" value="record-user">
       
   211           <table>
       
   212 <?
       
   213 $countinput=0;
       
   214 $rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
       
   215 if($rec_result != -1)
       
   216 {
       
   217 ?>
       
   218            <tr>
       
   219 	    <th>&nbsp;</th>
       
   220 <? 
       
   221 	if (level(10) && $domain_type != "SLAVE") 
       
   222 	{ 
       
   223 		echo "<th class=\"n\">" . _('Sub-owners') . "</td>"; 
       
   224 	} 
       
   225 ?>
       
   226 	    <th><? echo _('Name'); ?></th>
       
   227 	    <th><? echo _('Type'); ?></th>
       
   228 	    <th><? echo _('Content'); ?></th>
       
   229 	    <th><? echo _('Priority'); ?></th>
       
   230 	    <th><? echo _('TTL'); ?></th>
       
   231            </tr>
       
   232 <?
       
   233   	$recs = sort_zone($rec_result);
       
   234   	foreach($recs as $r)
       
   235   	{
       
   236 ?>
       
   237            <tr>
       
   238 	    <td class="n">
       
   239 <?
       
   240 		if ($domain_type != "SLAVE" )
       
   241 		{	
       
   242 			if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
    75 			{
   243 			{
    76 				unset($add);
   244 ?>
    77 				if ($u["id"] == $info["ownerid"])
   245              <a href="edit_record.php?id=<? echo $r['id'] ?>&amp;domain=<? echo $_GET["id"] ?>"><img src="images/edit.gif" alt="[ <? echo _('Edit record'); ?> ]"></a>
    78 				{
   246              <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>
    79 					$add = " SELECTED";
   247 <?
    80 				}
       
    81 				?>
       
    82 				<OPTION<?= $add ?> VALUE="<?= $u["id"] ?>"><?= $u["fullname"] ?></OPTION><?
       
    83 			}
   248 			}
    84 			?>
   249 		}
    85 			</SELECT>
   250 		if(level(10) && $domain_type != "SLAVE") 
    86 		</TD>
   251 		{ 
    87 		<TD CLASS="none" VALIGN="middle"  align="right">
   252 ?>
    88 			<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="<? echo _('Add'); ?>">
   253 	     <input type="checkbox" name="rowid[<? echo $countinput++?>]" value="<? echo $r['id']?>" />
    89 		</TD>
   254 <? 
    90 		</FORM>
   255 		}
    91 	</TR>
   256 ?>
    92 	<TR>
   257             </td>
    93 		<TD CLASS="text" COLSPAN="2">&nbsp;</TD>
   258 <? 
    94 	</TR>
   259 		if (level(10) && $domain_type != "SLAVE") 
    95 <? 
   260 		{ 
    96 
   261 ?>
    97 if(isset($info["ownerid"]))
   262             <td class="n">
    98 {?>
   263 <? 
    99 	<TR>
   264 			$x_result = $db->query("SELECT r.user_id,u.username,u.fullname FROM record_owners as r, users as u WHERE r.record_id='".$r['id']."' AND u.id=r.user_id");
   100 		<TD CLASS="text" ALIGN="left" COLSPAN="2" style="width:150px;">
   265 			echo "<select style=\"width:120px;\">";
   101 			<B><? echo _('Current listed owners'); ?>:</B>
   266 			while ($x_r = $x_result->fetchRow()) {
   102 		</TD>
   267 				echo "<option value=\"".$x_r["username"]."\">".$x_r["fullname"]."</option>";
   103 	</TR>
   268 			}
   104 	<?
   269 			echo "</select>";
   105 	$userRes = get_users_from_domain_id($_GET["id"]);
   270 ?>
   106 	foreach($userRes as $user)
   271             </td>
   107 	{ ?>
   272 <? 
   108 		<TR>
   273 		} 
   109 			<FORM METHOD="post" ACTION="edit.php?id=<?=$_GET['id']?>">
   274 ?>
   110 			<TD CLASS="text" ALIGN="left" style="width:150px;">
   275 	    <td class="y"><? echo $r['name'] ?></td>
   111 				<?=$user["fullname"]?>
   276 	    <td class="y"><? echo $r['type'] ?></td>
   112 			</TD>
   277 	    <td class="y"><? echo $r['content'] ?></td>
   113 			<TD CLASS="text" align="right">
   278 <?
   114 				<INPUT TYPE="hidden" NAME="del_user" VALUE="<?=$user["id"]?>">
   279 		if ($r['prio'] != 0) 
   115 				<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="<? echo _('Delete'); ?>">
   280 		{
   116 			</TD>
   281 ?>
   117 			</FORM>
   282             <td class="y"><? echo $r['prio']; ?></td>
   118 		</TR>
   283 <?
   119 	<? }
   284 		} else {
   120 }} ?>
   285 ?>
   121 
   286             <td class="n"></td><?
   122 
   287 		}
   123 <? if(level(5) && $MASTER_SLAVE_FUNCTIONS)
   288 ?>
   124 {
   289             <td class="y"><? echo $r['ttl'] ?></td>
   125     $domain_type=get_domain_type($_GET['id']);
   290 	   </tr>
   126     // Let the user change the domain type.
   291 <?
   127 ?>
       
   128         <TR>
       
   129             <TD CLASS="text" COLSPAN="2">&nbsp;</TD>
       
   130         </TR>
       
   131 		<TR>
       
   132 			<TD CLASS="text" COLSPAN="2"><B><? echo _('Type of this domain'); ?>: </B><?=$domain_type?></TD>
       
   133 		</TR>
       
   134 		<FORM ACTION="<?=$_SERVER['PHP_SELF']?>?&amp;id=<?=$_GET['id']?>" METHOD="post">
       
   135 		<TR>
       
   136             <TD CLASS="text"><B><? echo _('Change type'); ?>: </B>
       
   137                 <SELECT NAME="newtype">
       
   138                 <?
       
   139                 foreach($server_types as $s)
       
   140                 {
       
   141                     unset($add);
       
   142 				    if ($s == $domain_type)
       
   143 				    {
       
   144 					   $add = " SELECTED";
       
   145 				    }
       
   146                     ?><OPTION<?=$add ?> VALUE="<?=$s?>"><?=$s?></OPTION><?
       
   147                 }
       
   148                 ?>
       
   149                 </SELECT>
       
   150             </TD>
       
   151             <TD CLASS="text">
       
   152                 <INPUT TYPE="submit" CLASS="sbutton" NAME="type_change" VALUE="<? echo _('Change'); ?>">
       
   153             </TD>
       
   154         </TR>
       
   155         </FORM>
       
   156 <? } ?>
       
   157 </TABLE>
       
   158 <br />
       
   159 <FONT CLASS="nav">
       
   160 <A HREF="index.php"><? echo _('DNS Admin'); ?></A> &gt;&gt; <?= get_domain_name_from_id($_GET["id"]) ?>
       
   161 </FONT>
       
   162 <br /><br /><small><b><? echo _('Number of records'); ?>:</b> <?= $info["numrec"] ?>
       
   163 
       
   164 <?
       
   165 show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
       
   166 ?>
       
   167 
       
   168 <br /><br />
       
   169 
       
   170 <form action="<?=$_SERVER["PHP_SELF"]?>?id=<?=$_GET["id"]?>" method="post">
       
   171 <input type="hidden" name="action" value="record-user" />
       
   172 
       
   173 <TABLE BORDER="0" CELLSPACING="4">
       
   174 <?
       
   175 
       
   176 $countinput=0;
       
   177 
       
   178 $rec_result = get_records_from_domain_id($_GET["id"],ROWSTART,ROWAMOUNT);
       
   179 
       
   180 if($rec_result != -1)
       
   181 {
       
   182 	?>
       
   183 	<TR STYLE="font-weight: Bold;">
       
   184 	<TD CLASS="tdbg">&nbsp;</TD>
       
   185 	<? if (level(10)) { echo "<TD CLASS=\"tdbg\">" . _('Sub-owners') . "</TD>"; } ?>
       
   186 	<TD CLASS="tdbg"><? echo _('Name'); ?></TD>
       
   187 	<TD CLASS="tdbg"><? echo _('Type'); ?></TD>
       
   188 	<TD CLASS="tdbg"><? echo _('Content'); ?></TD>
       
   189 	<TD CLASS="tdbg"><? echo _('Priority'); ?></TD>
       
   190 	<TD CLASS="tdbg"><? echo _('TTL'); ?></TD>
       
   191 	</TR>
       
   192 	<?
       
   193 	$recs = sort_zone($rec_result);
       
   194 	foreach($recs as $r)
       
   195 	{
       
   196 	        ?><TR><TD CLASS="tdbg"><?
       
   197 
       
   198 	        if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
       
   199 	        {
       
   200                 // get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) <-- hmm..
       
   201                 ?>
       
   202 	            <A HREF="edit_record.php?id=<?= $r['id'] ?>&amp;domain=<?= $_GET["id"] ?>"><IMG SRC="images/edit.gif" ALT="[ <? echo _('Edit record'); ?> ]" BORDER="0"></A>
       
   203 	            <A HREF="delete_record.php?id=<?= $r['id'] ?>&amp;domain=<?= $_GET["id"] ?>"><IMG SRC="images/delete.gif" ALT="[ <? echo _('Delete record'); ?> ]" BORDER="0"></A>
       
   204 	            <?
       
   205 	        }
       
   206 
       
   207 if(level(10)) { ?>
       
   208 
       
   209 <input type="checkbox" name="rowid[<?=$countinput++?>]" value="<?=$r['id']?>" />
       
   210 
       
   211 <? }
       
   212 		
       
   213 	        ?></TD>
       
   214 		
       
   215 <? if (level(10)) { ?>
       
   216 		<TD STYLE="border: 1px solid #000;width:120px">
       
   217 <?
       
   218 $x_result = $db->query("SELECT r.user_id,u.username FROM record_owners as r, users as u WHERE r.record_id='".$r['id']."' AND u.id=r.user_id");
       
   219 echo "<select style=\"width:120px;font-size:9px\">";
       
   220 while ($x_r = $x_result->fetchRow()) {
       
   221    echo "<option>".$x_r["username"]."</option>";
       
   222 }
       
   223 echo "</select>";
       
   224 ?>
       
   225 		</TD>
       
   226 <? } ?>
       
   227 		<TD STYLE="border: 1px solid #000000;"><?= $r['name'] ?></TD><TD STYLE="border: 1px solid #000000;"><?= $r['type'] ?></TD><TD STYLE="border: 1px solid #000000;"><?= $r['content'] ?></TD><?
       
   228 	        if ($r['prio'] != 0) {
       
   229 	                ?><TD STYLE="border: 1px solid #000000;"><?= $r['prio']; ?></TD><?
       
   230 	        } else {
       
   231 	                ?><TD CLASS="tdbg"></TD><?
       
   232 	        }
       
   233 	        ?><TD STYLE="border: 1px solid #000000;"><?= $r['ttl'] ?></TD></TR>
       
   234 	        <?
       
   235 	}
   292 	}
   236 }
   293 }
   237 else
   294 else
   238 {
   295 {
   239 	?>
   296 ?>
   240 	<TR>
   297            <tr>
   241 	<TD CLASS="tdbg"><DIV CLASS="warning"><? echo _('No records for this domain.'); ?></DIV></TD>
   298             <td class="n">
   242 	</TR>
   299 	     <div class="warning"><? echo _('No records for this zone.'); ?></div>
   243 	<?
   300 	    </td>
   244 }
   301            </tr>
   245 ?>
   302 <?
   246 
   303 }
   247 </TABLE>
   304 ?>
   248 
   305           </table>
   249 <? if (level(10)) { ?>
   306 
   250 <br>
   307 <?
   251 
   308 if ($domain_type != "SLAVE")
   252 <img src="images/arrow.png" alt="arrow" style="margin-left:47px"/>
   309 {
   253 <select name="userid">
   310 	if (level(10)) { ?>
   254 <?
   311 	   <img src="images/arrow.png" alt="arrow" class="edit-assign-to-user">
   255 $users = show_users();
   312 	   <select name="userid">
   256 foreach ($users as $user) {
   313 		<?
   257 	echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
   314 		$users = show_users();
   258 }
   315 		foreach ($users as $user) {
   259 ?>
   316 			echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
   260 </select>
   317 		}
   261 
   318 		?>
   262 <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
   319            </select>
   263 </form>
   320 	   <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
   264 <? } ?>
   321 	  </form>
   265 
   322 <? 
   266 <BR><BR>
   323 	} 
   267 
       
   268 <?
       
   269 if ($_SESSION[$_GET["id"]."_ispartial"] != 1)  {
       
   270 ?>
       
   271 <INPUT TYPE="button" CLASS="button" OnClick="location.href='add_record.php?id=<?= $_GET["id"] ?>'" VALUE="<? echo _('Add record'); ?>">
       
   272 <?
       
   273 }
       
   274 ?>
       
   275 
       
   276 <? if (level(5)) { ?>&nbsp;&nbsp;<INPUT TYPE="button" CLASS="button" OnClick="location.href='delete_domain.php?id=<?= $_GET["id"] ?>'" VALUE="<? echo _('Delete zone'); ?>"><?
       
   277 }
   324 }
   278 include_once("inc/footer.inc.php");
   325 include_once("inc/footer.inc.php");
   279 ?>
   326 ?>