1
+ − 1
<?php
+ − 2
13
+ − 3
require_once ( "inc/toolkit.inc.php" );
1
+ − 4
37
+ − 5
$xsid = ( isset ( $_GET [ 'id' ])) ? $_GET [ 'id' ] : $_POST [ 'zoneid' ];
+ − 6
if (( ! level ( 5 )) && (( ! xs ( $xsid ) || ( $_SESSION [ $xsid . '_ispartial' ])))) {
+ − 7
error ( ERR_RECORD_ACCESS_DENIED );
+ − 8
}
+ − 9
1
+ − 10
if ( $_POST [ "commit" ]) {
+ − 11
$ret = add_record ( $_POST [ "zoneid" ], $_POST [ "name" ], $_POST [ "type" ], $_POST [ "content" ], $_POST [ "ttl" ], $_POST [ "prio" ]);
+ − 12
if ( $ret != '1' ) {
+ − 13
die ( " $ret " );
+ − 14
}
+ − 15
clean_page ( "edit.php?id=" . $_POST [ "zoneid" ]);
+ − 16
}
13
+ − 17
1
+ − 18
include_once ( "inc/header.inc.php" );
+ − 19
?>
13
+ − 20
+ − 21
<h2> <? echo _ ( 'Add record to zone' ); ?> "<? echo get_domain_name_from_id ( $_GET [ "id" ]) ?> "</H2>
1
+ − 22
13
+ − 23
<form method= "post" >
+ − 24
<input type= "hidden" name= "zoneid" value= " <? echo $_GET [ "id" ] ?> " >
+ − 25
<table border= "0" cellspacing= "4" >
+ − 26
<tr>
+ − 27
<td class= "n" > <? echo _ ( 'Name' ); ?> </td>
+ − 28
<td class= "n" > </td>
+ − 29
<td class= "n" > <? echo _ ( 'Type' ); ?> </td>
+ − 30
<td class= "n" > <? echo _ ( 'Priority' ); ?> </td>
+ − 31
<td class= "n" > <? echo _ ( 'Content' ); ?> </td>
+ − 32
<td class= "n" > <? echo _ ( 'TTL' ); ?> </td>
+ − 33
</tr>
+ − 34
<tr>
+ − 35
<td class= "n" ><input type= "text" name= "name" class= "input" > .<? echo get_domain_name_from_id ( $_GET [ "id" ]) ?> </td>
+ − 36
<td class= "n" > IN</td>
+ − 37
<td class= "n" >
+ − 38
<select name= "type" >
1
+ − 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
}
13
+ − 49
?> <option <? echo $add ?> value= " <? echo $c ?> " > <? echo $c ?> </option> <?
1
+ − 50
}
13
+ − 51
?>
+ − 52
</select>
+ − 53
</td>
+ − 54
<td class= "n" ><input type= "text" name= "prio" class= "sinput" ></td>
+ − 55
<td class= "n" ><input type= "text" name= "content" class= "input" ></td>
+ − 56
<td class= "n" ><input type= "text" name= "ttl" class= "sinput" value= " <? echo $DEFAULT_TTL ?> " ></td>
+ − 57
</tr>
+ − 58
</table>
+ − 59
<br>
+ − 60
<input type= "submit" name= "commit" value= " <? echo _ ( 'Add record' ); ?> " class= "button" >
+ − 61
</form>
1
+ − 62
+ − 63
<? include_once ( "inc/footer.inc.php" ); ?>