1
|
1 |
<?php |
|
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: 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"]) { |
|
23 |
$ret = add_record($_POST["zoneid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]); |
|
24 |
if ($ret != '1') { |
|
25 |
die("$ret"); |
|
26 |
} |
|
27 |
clean_page("edit.php?id=".$_POST["zoneid"]); |
|
28 |
} |
|
29 |
include_once("inc/header.inc.php"); |
|
30 |
?> |
|
31 |
<H2>Add record to zone "<?= get_domain_name_from_id($_GET["id"]) ?>"</H2> |
|
32 |
<FONT CLASS="nav"><BR><A HREF="index.php">DNS Admin</A> >> <A HREF="edit.php?id=<?= $_GET["id"] ?>"><?= get_domain_name_from_id($_GET["id"]) ?></A> >> Add record<BR><BR></FONT> |
|
33 |
|
|
34 |
<FORM METHOD="post"> |
|
35 |
<INPUT TYPE="hidden" NAME="zoneid" VALUE="<?= $_GET["id"] ?>"> |
|
36 |
<TABLE BORDER="0" CELLSPACING="4"> |
|
37 |
<TR STYLE="font-weight: Bold"><TD CLASS="tdbg">Name</TD><TD CLASS="tdbg"> </TD><TD CLASS="tdbg">Type</TD><TD CLASS="tdbg">Priority</TD><TD CLASS="tdbg">Content</TD><TD CLASS="tdbg">TimeToLive</TD></TR> |
|
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"> |
|
39 |
<? |
|
40 |
$dname = get_domain_name_from_id($_GET["id"]); |
|
41 |
foreach (get_record_types() as $c) { |
|
42 |
if (eregi('in-addr.arpa', $dname) && strtoupper($c) == 'PTR') { |
|
43 |
$add = " SELECTED"; |
|
44 |
} elseif (strtoupper($c) == 'A') { |
|
45 |
$add = " SELECTED"; |
|
46 |
} else { |
|
47 |
unset($add); |
|
48 |
} |
|
49 |
?><OPTION<?= $add ?> VALUE="<?= $c ?>"><?= $c ?></OPTION><? |
|
50 |
} |
|
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> |
|
52 |
</TABLE> |
|
53 |
<BR><INPUT TYPE="submit" NAME="commit" VALUE="Add record" CLASS="button"> |
|
54 |
</FORM> |
|
55 |
|
|
56 |
<? include_once("inc/footer.inc.php"); ?> |