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)) { |
|
31 |
$checkPartial = $db->queryOne("SELECT id FROM record_owners WHERE record_id='".$_GET["id"]."' AND user_id='".$_SESSION["userid"]."' LIMIT 1"); |
|
32 |
if (empty($checkPartial)) { |
|
33 |
error(ERR_RECORD_ACCESS_DENIED); |
|
34 |
} |
|
35 |
} |
1
|
36 |
if ($_GET["confirm"] == '0') { |
|
37 |
clean_page("edit.php?id=".$_GET["domain"]); |
|
38 |
} elseif ($_GET["confirm"] == '1') { |
|
39 |
delete_record($_GET["id"]); |
|
40 |
clean_page("edit.php?id=".$_GET["domain"]); |
|
41 |
} |
|
42 |
include_once("inc/header.inc.php"); |
13
|
43 |
?> |
|
44 |
|
|
45 |
<h2><? echo _('Delete record'); ?> "<? |
1
|
46 |
$data = get_record_from_id($_GET["id"]); |
|
47 |
print $data["name"]." IN ".$data["type"]." ".$data["content"]; |
13
|
48 |
?>"</h2><? |
1
|
49 |
if (($data["type"] == "NS" && $data["name"] == get_domain_name_from_id($_GET["domain"])) || $data["type"] == "SOA") { |
13
|
50 |
print "<font class=\"warning\">" . _('You are trying to delete a record that is needed for this zone to work.') . "</font><br>"; |
1
|
51 |
} |
13
|
52 |
?><br><font class="warning"><? echo _('Are you sure?'); ?></font><br><br> |
|
53 |
<input type="button" class="button" OnClick="location.href='<? echo $_SERVER["REQUEST_URI"] ?>&confirm=1'" value="<? echo _('Yes'); ?>"> |
|
54 |
<input type="button" class="button" OnClick="location.href='<? echo $_SERVER["REQUEST_URI"] ?>&confirm=0'" value="<? echo _('No'); ?>"> |
1
|
55 |
<? |
|
56 |
} else { |
|
57 |
include_once("inc/header.inc.php"); |
37
|
58 |
echo _("Nothing to do!"); |
1
|
59 |
} |
|
60 |
include_once("inc/footer.inc.php"); |