add_record.php
changeset 13 2ff220cfde13
parent 3 64525a2eb098
child 37 b785e54690ce
equal deleted inserted replaced
12:7be4525290cc 13:2ff220cfde13
     1 <?php
     1 <?php
     2 
     2 
     3 // +--------------------------------------------------------------------+
     3 require_once("inc/toolkit.inc.php");
     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 
     4 
    17 //
       
    18 // $Id: add_record.php,v 1.6 2003/02/05 15:25:01 azurazu Exp $
       
    19 //
       
    20 
       
    21 require_once("inc/toolkit.inc.php");
       
    22 if ($_POST["commit"]) {
     5 if ($_POST["commit"]) {
    23         $ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
     6         $ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
    24         if ($ret != '1') {
     7         if ($ret != '1') {
    25                 die("$ret");
     8                 die("$ret");
    26         }
     9         }
    27         clean_page("edit.php?id=".$_POST["zoneid"]);
    10         clean_page("edit.php?id=".$_POST["zoneid"]);
    28 }
    11 }
       
    12 
    29 include_once("inc/header.inc.php");
    13 include_once("inc/header.inc.php");
    30 ?>
    14 ?>
    31 <H2><? echo _('Add record to zone'); ?> "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2>
       
    32 <FONT CLASS="nav"><BR><A HREF="index.php"><? echo _('DNS Admin'); ?></A> &gt;&gt; <A HREF="edit.php?id=<?= $_GET["id"] ?>"><?= get_domain_name_from_id($_GET["id"]) ?></A> &gt;&gt; <? echo _('Add record'); ?><BR><BR></FONT>
       
    33 
    15 
    34 <FORM METHOD="post">
    16     <h2><? echo _('Add record to zone'); ?> "<? echo get_domain_name_from_id($_GET["id"]) ?>"</H2>
    35 <INPUT TYPE="hidden" NAME="zoneid" VALUE="<?= $_GET["id"] ?>">
    17 
    36 <TABLE BORDER="0" CELLSPACING="4">
    18     <form method="post">
    37 <TR STYLE="font-weight: Bold"><TD CLASS="tdbg"><? echo _('Name'); ?></TD><TD CLASS="tdbg">&nbsp;</TD><TD CLASS="tdbg"><? echo _('Type'); ?></TD><TD CLASS="tdbg"><? echo _('Priority'); ?></TD><TD CLASS="tdbg"><? echo _('Content'); ?></TD><TD CLASS="tdbg"><? echo _('TTL'); ?></TD></TR>
    19      <input type="hidden" name="zoneid" value="<? echo $_GET["id"] ?>">
    38 <TR><TD CLASS="tdbg"><INPUT TYPE="text" NAME="name" CLASS="input">.<?= get_domain_name_from_id($_GET["id"]) ?></TD><TD CLASS="tdbg">IN</TD><TD CLASS="tdbg"><SELECT NAME="type">
    20      <table border="0" cellspacing="4">
       
    21       <tr>
       
    22        <td class="n"><? echo _('Name'); ?></td>
       
    23        <td class="n">&nbsp;</td>
       
    24        <td class="n"><? echo _('Type'); ?></td>
       
    25        <td class="n"><? echo _('Priority'); ?></td>
       
    26        <td class="n"><? echo _('Content'); ?></td>
       
    27        <td class="n"><? echo _('TTL'); ?></td>
       
    28       </tr>
       
    29       <tr>
       
    30        <td class="n"><input type="text" name="name" class="input">.<? echo get_domain_name_from_id($_GET["id"]) ?></td>
       
    31        <td class="n">IN</td>
       
    32        <td class="n">
       
    33         <select name="type">
    39 <?
    34 <?
    40 $dname = get_domain_name_from_id($_GET["id"]);
    35 $dname = get_domain_name_from_id($_GET["id"]);
    41 foreach (get_record_types() as $c) {
    36 foreach (get_record_types() as $c) {
    42         if (eregi('in-addr.arpa', $dname) && strtoupper($c) == 'PTR') {
    37         if (eregi('in-addr.arpa', $dname) && strtoupper($c) == 'PTR') {
    43                 $add = " SELECTED";
    38                 $add = " SELECTED";
    44         } elseif (strtoupper($c) == 'A') {
    39         } elseif (strtoupper($c) == 'A') {
    45                 $add = " SELECTED";
    40                 $add = " SELECTED";
    46         } else {
    41         } else {
    47                 unset($add);
    42                 unset($add);
    48         }
    43         }
    49         ?><OPTION<?= $add ?> VALUE="<?= $c ?>"><?= $c ?></OPTION><?
    44         ?><option<? echo $add ?> value="<? echo $c ?>"><? echo $c ?></option><?
    50 }
    45 }
    51 ?></SELECT></TD><TD CLASS="tdbg"><INPUT TYPE="text" NAME="prio" CLASS="sinput"></TD><TD CLASS="tdbg"><INPUT TYPE="text" NAME="content" CLASS="input"></TD><TD CLASS="tdbg"><INPUT TYPE="text" NAME="ttl" CLASS="sinput" VALUE="<?=$DEFAULT_TTL?>"></TD></TR>
    46 ?>
    52 </TABLE>
    47         </select>
    53 <BR><INPUT TYPE="submit" NAME="commit" VALUE="<? echo _('Add record'); ?>" CLASS="button">
    48        </td>
    54 </FORM>
    49        <td class="n"><input type="text" name="prio" class="sinput"></td>
       
    50        <td class="n"><input type="text" name="content" class="input"></td>
       
    51        <td class="n"><input type="text" name="ttl" class="sinput" value="<? echo $DEFAULT_TTL?>"></td>
       
    52       </tr>
       
    53      </table>
       
    54      <br>
       
    55      <input type="submit" name="commit" value="<? echo _('Add record'); ?>" class="button">
       
    56     </form>
    55 
    57 
    56 <? include_once("inc/footer.inc.php"); ?>
    58 <? include_once("inc/footer.inc.php"); ?>