edit.php
changeset 2 9a485c41cfcf
parent 1 58094faf794d
child 3 64525a2eb098
equal deleted inserted replaced
1:58094faf794d 2:9a485c41cfcf
    47 	delete_owner($_GET["id"], $_POST["del_user"]);
    47 	delete_owner($_GET["id"], $_POST["del_user"]);
    48 }
    48 }
    49 
    49 
    50 include_once("inc/header.inc.php");
    50 include_once("inc/header.inc.php");
    51 ?>
    51 ?>
    52 <H2>Edit domain "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2>
    52 <H2><? echo _('Edit domain'); ?> "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2>
    53 <?
    53 <?
    54 $info = get_domain_info_from_id($_GET["id"]);
    54 $info = get_domain_info_from_id($_GET["id"]);
    55 if(!isset($info["ownerid"]))
    55 if(!isset($info["ownerid"]))
    56 {
    56 {
    57 	?>
    57 	?>
    58 	<P CLASS="warning">This domain isnt owned by anyone yet, please assign someone</P>
    58 	<P CLASS="warning"><? echo _('This domain isnt owned by anyone yet, please assign someone.'); ?></P>
    59 	<?
    59 	<?
    60 }
    60 }
    61 ?>
    61 ?>
    62 
    62 
    63 <TABLE class="text" cellspacing="0" style="width: 280px">
    63 <TABLE class="text" cellspacing="0" style="width: 280px">
    64 <? if (level(5)) 
    64 <? if (level(5)) 
    65 { ?>	
    65 { ?>	
    66 	<TR>
    66 	<TR>
    67 		<FORM METHOD="post" ACTION="edit.php?id=<?=$_GET['id']?>">
    67 		<FORM METHOD="post" ACTION="edit.php?id=<?=$_GET['id']?>">
    68 		<TD CLASS="none" VALIGN="middle" style="width: 250px;">
    68 		<TD CLASS="none" VALIGN="middle" style="width: 250px;">
    69 			<B>Add an owner:</B>
    69 			<B><? echo _('Add an owner'); ?>:</B>
    70 			<INPUT TYPE="hidden" NAME="domain" VALUE="<?= $_GET["id"] ?>">
    70 			<INPUT TYPE="hidden" NAME="domain" VALUE="<?= $_GET["id"] ?>">
    71 			<SELECT NAME="newowner">
    71 			<SELECT NAME="newowner">
    72 			<?
    72 			<?
    73 			$users = show_users();
    73 			$users = show_users();
    74 			foreach ($users as $u)
    74 			foreach ($users as $u)
    83 			}
    83 			}
    84 			?>
    84 			?>
    85 			</SELECT>
    85 			</SELECT>
    86 		</TD>
    86 		</TD>
    87 		<TD CLASS="none" VALIGN="middle"  align="right">
    87 		<TD CLASS="none" VALIGN="middle"  align="right">
    88 			<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="add">
    88 			<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="<? echo _('add'); ?>">
    89 		</TD>
    89 		</TD>
    90 		</FORM>
    90 		</FORM>
    91 	</TR>
    91 	</TR>
    92 	<TR>
    92 	<TR>
    93 		<TD CLASS="text">&nbsp;</TD>
    93 		<TD CLASS="text">&nbsp;</TD>
    96 
    96 
    97 if(isset($info["ownerid"]))
    97 if(isset($info["ownerid"]))
    98 {?>
    98 {?>
    99 	<TR>
    99 	<TR>
   100 		<TD CLASS="text" ALIGN="left" COLSPAN="2" style="width:150px;">
   100 		<TD CLASS="text" ALIGN="left" COLSPAN="2" style="width:150px;">
   101 			<B>Current listed owners:</B>
   101 			<B><? echo _('Current listed owners'); ?>:</B>
   102 		</TD>
   102 		</TD>
   103 	</TR>
   103 	</TR>
   104 	<?
   104 	<?
   105 	$userRes = get_users_from_domain_id($_GET["id"]);
   105 	$userRes = get_users_from_domain_id($_GET["id"]);
   106 	foreach($userRes as $user)
   106 	foreach($userRes as $user)
   110 			<TD CLASS="text" ALIGN="left" style="width:150px;">
   110 			<TD CLASS="text" ALIGN="left" style="width:150px;">
   111 				<?=$user["fullname"]?>
   111 				<?=$user["fullname"]?>
   112 			</TD>
   112 			</TD>
   113 			<TD CLASS="text" align="right">
   113 			<TD CLASS="text" align="right">
   114 				<INPUT TYPE="hidden" NAME="del_user" VALUE="<?=$user["id"]?>">
   114 				<INPUT TYPE="hidden" NAME="del_user" VALUE="<?=$user["id"]?>">
   115 				<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="delete">
   115 				<INPUT TYPE="submit" CLASS="sbutton" NAME="co" VALUE="<? echo _('delete'); ?>">
   116 			</TD>
   116 			</TD>
   117 			</FORM>
   117 			</FORM>
   118 		</TR>
   118 		</TR>
   119 	<? }
   119 	<? }
   120 }} ?>
   120 }} ?>
   127 ?>
   127 ?>
   128         <TR>
   128         <TR>
   129             <TD CLASS="text">&nbsp;</TD>
   129             <TD CLASS="text">&nbsp;</TD>
   130         </TR>
   130         </TR>
   131 		<TR>
   131 		<TR>
   132 			<TD CLASS="text" COLSPAN="2"><B>Type of this domain: </B><?=$domain_type?></TD>
   132 			<TD CLASS="text" COLSPAN="2"><B><? echo _('Type of this domain'); ?>: </B><?=$domain_type?></TD>
   133 		</TR>
   133 		</TR>
   134 		<FORM ACTION="<?=$_SERVER['PHP_SELF']?>?&amp;id=<?=$_GET['id']?>" METHOD="post">
   134 		<FORM ACTION="<?=$_SERVER['PHP_SELF']?>?&amp;id=<?=$_GET['id']?>" METHOD="post">
   135 		<TR>
   135 		<TR>
   136             <TD CLASS="text"><B>Change type: </B>
   136             <TD CLASS="text"><B><? echo _('Change type'); ?>: </B>
   137                 <SELECT NAME="newtype">
   137                 <SELECT NAME="newtype">
   138                 <?
   138                 <?
   139                 foreach($server_types as $s)
   139                 foreach($server_types as $s)
   140                 {
   140                 {
   141                     unset($add);
   141                     unset($add);
   147                 }
   147                 }
   148                 ?>
   148                 ?>
   149                 </SELECT>
   149                 </SELECT>
   150             </TD>
   150             </TD>
   151             <TD CLASS="text">
   151             <TD CLASS="text">
   152                 <INPUT TYPE="submit" CLASS="sbutton" NAME="type_change" VALUE="change">
   152                 <INPUT TYPE="submit" CLASS="sbutton" NAME="type_change" VALUE="<? echo _('change'); ?>">
   153             </TD>
   153             </TD>
   154         </TR>
   154         </TR>
   155         </FORM>
   155         </FORM>
   156 <? } ?>
   156 <? } ?>
   157 </TABLE>
   157 </TABLE>
   158 <br />
   158 <br />
   159 <FONT CLASS="nav">
   159 <FONT CLASS="nav">
   160 <A HREF="index.php">DNS Admin</A> &gt;&gt; <?= get_domain_name_from_id($_GET["id"]) ?>
   160 <A HREF="index.php"><? echo _('DNS Admin'); ?></A> &gt;&gt; <?= get_domain_name_from_id($_GET["id"]) ?>
   161 </FONT>
   161 </FONT>
   162 <br /><br /><small><b>Number of records:</b> <?= $info["numrec"] ?>
   162 <br /><br /><small><b><? echo _('Number of records'); ?>:</b> <?= $info["numrec"] ?>
   163 
   163 
   164 <?
   164 <?
   165 show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
   165 show_pages($info["numrec"],ROWAMOUNT,$_GET["id"]);
   166 ?>
   166 ?>
   167 
   167 
   180 if($rec_result != -1)
   180 if($rec_result != -1)
   181 {
   181 {
   182 	?>
   182 	?>
   183 	<TR STYLE="font-weight: Bold;">
   183 	<TR STYLE="font-weight: Bold;">
   184 	<TD CLASS="tdbg">&nbsp;</TD>
   184 	<TD CLASS="tdbg">&nbsp;</TD>
   185 	<? if (level(10)) { echo "<TD CLASS=\"tdbg\">Sub-Owners</TD>"; } ?>
   185 	<? if (level(10)) { echo "<TD CLASS=\"tdbg\">" . _('Sub-Owners') . "</TD>"; } ?>
   186 	<TD CLASS="tdbg">Name</TD>
   186 	<TD CLASS="tdbg"><? echo _('Name'); ?></TD>
   187 	<TD CLASS="tdbg">Type</TD>
   187 	<TD CLASS="tdbg"><? echo _('Type'); ?></TD>
   188 	<TD CLASS="tdbg">Content</TD>
   188 	<TD CLASS="tdbg"><? echo _('Content'); ?></TD>
   189 	<TD CLASS="tdbg">Priority</TD>
   189 	<TD CLASS="tdbg"><? echo _('Priority'); ?></TD>
   190 	<TD CLASS="tdbg">TTL</TD>
   190 	<TD CLASS="tdbg"><? echo _('TTL'); ?></TD>
   191 	</TR>
   191 	</TR>
   192 	<?
   192 	<?
   193 	$recs = sort_zone($rec_result);
   193 	$recs = sort_zone($rec_result);
   194 	foreach($recs as $r)
   194 	foreach($recs as $r)
   195 	{
   195 	{
   197 
   197 
   198 	        if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
   198 	        if(level(5) || (!($r["type"] == "SOA" && !$GLOBALS["ALLOW_SOA_EDIT"]) && !($r["type"] == "NS" && !$GLOBALS["ALLOW_NS_EDIT"])))
   199 	        {
   199 	        {
   200                 // get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) <-- hmm..
   200                 // get_name_from_record_id($r["id"]) != get_domain_name_from_id(recid_to_domid($r["id"])) <-- hmm..
   201                 ?>
   201                 ?>
   202 	            <A HREF="edit_record.php?id=<?= $r['id'] ?>&amp;domain=<?= $_GET["id"] ?>"><IMG SRC="images/edit.gif" ALT="[ edit record ]" BORDER="0"></A>
   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="[ delete 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 	            <?
   204 	            <?
   205 	        }
   205 	        }
   206 
   206 
   207 if(level(10)) { ?>
   207 if(level(10)) { ?>
   208 
   208 
   236 }
   236 }
   237 else
   237 else
   238 {
   238 {
   239 	?>
   239 	?>
   240 	<TR>
   240 	<TR>
   241 	<TD CLASS="tdbg"><DIV CLASS="warning">No records for this domain</DIV></TD>
   241 	<TD CLASS="tdbg"><DIV CLASS="warning"><? echo _('No records for this domain.'); ?></DIV></TD>
   242 	</TR>
   242 	</TR>
   243 	<?
   243 	<?
   244 }
   244 }
   245 ?>
   245 ?>
   246 
   246 
   257 	echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
   257 	echo "<option value=\"".$user[id]."\">".$user[fullname]."</option>";
   258 }
   258 }
   259 ?>
   259 ?>
   260 </select>
   260 </select>
   261 
   261 
   262 <input type="submit" class="button" value="Assign to user">
   262 <input type="submit" class="button" value="<? echo _('Assign to user'); ?>">
   263 </form>
   263 </form>
   264 <? } ?>
   264 <? } ?>
   265 
   265 
   266 <BR><BR>
   266 <BR><BR>
   267 
   267 
   268 <?
   268 <?
   269 if ($_SESSION[$_GET["id"]."_ispartial"] != 1)  {
   269 if ($_SESSION[$_GET["id"]."_ispartial"] != 1)  {
   270 ?>
   270 ?>
   271 <INPUT TYPE="button" CLASS="button" OnClick="location.href='add_record.php?id=<?= $_GET["id"] ?>'" VALUE="Add record">
   271 <INPUT TYPE="button" CLASS="button" OnClick="location.href='add_record.php?id=<?= $_GET["id"] ?>'" VALUE="<? echo _('Add record'); ?>">
   272 <?
   272 <?
   273 }
   273 }
   274 ?>
   274 ?>
   275 
   275 
   276 <? if (level(5)) { ?>&nbsp;&nbsp;<INPUT TYPE="button" CLASS="button" OnClick="location.href='delete_domain.php?id=<?= $_GET["id"] ?>'" VALUE="Delete zone"><?
   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 }
   277 }
   278 include_once("inc/footer.inc.php");
   278 include_once("inc/footer.inc.php");
   279 ?>
   279 ?>