1
+ − 1
<?php
+ − 2
47
+ − 3
/* PowerAdmin, a friendly web-based admin tool for PowerDNS.
+ − 4
* See <https://rejo.zenger.nl/poweradmin> for more details.
+ − 5
*
+ − 6
* Copyright 2007, 2008 Rejo Zenger <rejo@zenger.nl>
+ − 7
*
+ − 8
* This program is free software: you can redistribute it and/or modify
+ − 9
* it under the terms of the GNU General Public License as published by
+ − 10
* the Free Software Foundation, either version 3 of the License, or
+ − 11
* (at your option) any later version.
+ − 12
*
+ − 13
* This program is distributed in the hope that it will be useful,
+ − 14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
+ − 15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ − 16
* GNU General Public License for more details.
+ − 17
*
+ − 18
* You should have received a copy of the GNU General Public License
+ − 19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
+ − 20
*/
+ − 21
1
+ − 22
require_once ( "inc/toolkit.inc.php" );
+ − 23
+ − 24
if ( $_GET [ "id" ]) {
37
+ − 25
// check if we have access to the given id
+ − 26
$zoneId = recid_to_domid ( $_GET [ 'id' ]);
+ − 27
if (( ! level ( 5 )) && ( ! xs ( $zoneId ))) {
+ − 28
error ( ERR_RECORD_ACCESS_DENIED );
+ − 29
}
+ − 30
if (( ! level ( 5 )) && ( $_SESSION [ $zoneId . '_ispartial' ] == 1 )) {
65
+ − 31
$db -> setLimit ( 1 );
+ − 32
$checkPartial = $db -> queryOne ( "SELECT id FROM record_owners WHERE record_id=" . $db -> quote ( $_GET [ "id" ]) . " AND user_id=" . $db -> quote ( $_SESSION [ "userid" ]));
37
+ − 33
if ( empty ( $checkPartial )) {
+ − 34
error ( ERR_RECORD_ACCESS_DENIED );
+ − 35
}
+ − 36
}
1
+ − 37
if ( $_GET [ "confirm" ] == '0' ) {
+ − 38
clean_page ( "edit.php?id=" . $_GET [ "domain" ]);
+ − 39
} elseif ( $_GET [ "confirm" ] == '1' ) {
+ − 40
delete_record ( $_GET [ "id" ]);
+ − 41
clean_page ( "edit.php?id=" . $_GET [ "domain" ]);
+ − 42
}
+ − 43
include_once ( "inc/header.inc.php" );
13
+ − 44
?>
+ − 45
+ − 46
<h2> <? echo _ ( 'Delete record' ); ?> " <?
1
+ − 47
$data = get_record_from_id ( $_GET [ "id" ]);
+ − 48
print $data [ "name" ] . " IN " . $data [ "type" ] . " " . $data [ "content" ];
13
+ − 49
?> "</h2> <?
1
+ − 50
if (( $data [ "type" ] == "NS" && $data [ "name" ] == get_domain_name_from_id ( $_GET [ "domain" ])) || $data [ "type" ] == "SOA" ) {
13
+ − 51
print "<font class= \" warning \" >" . _ ( 'You are trying to delete a record that is needed for this zone to work.' ) . "</font><br>" ;
1
+ − 52
}
13
+ − 53
?> <br><font class="warning"> <? echo _ ( 'Are you sure?' ); ?> </font><br><br>
+ − 54
<input type="button" class="button" OnClick="location.href=' <? echo $_SERVER [ "REQUEST_URI" ] ?> &confirm=1'" value=" <? echo _ ( 'Yes' ); ?> ">
+ − 55
<input type="button" class="button" OnClick="location.href=' <? echo $_SERVER [ "REQUEST_URI" ] ?> &confirm=0'" value=" <? echo _ ( 'No' ); ?> ">
1
+ − 56
<?
+ − 57
} else {
+ − 58
include_once ( "inc/header.inc.php" );
48
+ − 59
echo _ ( 'Nothing to do!' );
1
+ − 60
}
+ − 61
include_once ( "inc/footer.inc.php" );