add_record.php
author rejo
Sun, 22 Apr 2007 16:27:45 +0000
changeset 12 7be4525290cc
parent 3 64525a2eb098
child 13 2ff220cfde13
permissions -rw-r--r--
[feladat @ 28] Fixed a bug in dns.inc.php ($recordid missing from input on validate_input function).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     1
<?php
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     2
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     3
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     4
// | PowerAdmin								|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     5
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     6
// | Copyright (c) 1997-2002 The PowerAdmin Team			|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     7
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     8
// | This source file is subject to the license carried by the overal	|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
     9
// | program PowerAdmin as found on http://poweradmin.sf.net		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    10
// | The PowerAdmin program falls under the QPL License:		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    11
// | http://www.trolltech.com/developer/licensing/qpl.html		|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    12
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    13
// | Authors: Roeland Nieuwenhuis <trancer <AT> trancer <DOT> nl>	|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    14
// |          Sjeemz <sjeemz <AT> sjeemz <DOT> nl>			|
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    15
// +--------------------------------------------------------------------+
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    16
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    17
//
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    18
// $Id: add_record.php,v 1.6 2003/02/05 15:25:01 azurazu Exp $
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    19
//
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    20
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    21
require_once("inc/toolkit.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    22
if ($_POST["commit"]) {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    23
        $ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    24
        if ($ret != '1') {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    25
                die("$ret");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    26
        }
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    27
        clean_page("edit.php?id=".$_POST["zoneid"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    28
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    29
include_once("inc/header.inc.php");
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    30
?>
2
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    31
<H2><? echo _('Add record to zone'); ?> "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2>
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    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>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    33
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    34
<FORM METHOD="post">
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    35
<INPUT TYPE="hidden" NAME="zoneid" VALUE="<?= $_GET["id"] ?>">
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    36
<TABLE BORDER="0" CELLSPACING="4">
3
64525a2eb098 [feladat @ 4]
rejo
parents: 2
diff changeset
    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>
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    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">
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    39
<?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    40
$dname = get_domain_name_from_id($_GET["id"]);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    41
foreach (get_record_types() as $c) {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    42
        if (eregi('in-addr.arpa', $dname) && strtoupper($c) == 'PTR') {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    43
                $add = " SELECTED";
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    44
        } elseif (strtoupper($c) == 'A') {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    45
                $add = " SELECTED";
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    46
        } else {
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    47
                unset($add);
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    48
        }
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    49
        ?><OPTION<?= $add ?> VALUE="<?= $c ?>"><?= $c ?></OPTION><?
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    50
}
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    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>
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    52
</TABLE>
2
9a485c41cfcf [feladat @ 3]
rejo
parents: 1
diff changeset
    53
<BR><INPUT TYPE="submit" NAME="commit" VALUE="<? echo _('Add record'); ?>" CLASS="button">
1
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    54
</FORM>
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    55
58094faf794d [feladat @ 2]
rejo
parents:
diff changeset
    56
<? include_once("inc/footer.inc.php"); ?>