1
|
1 |
<?php |
|
2 |
|
|
3 |
require_once("inc/toolkit.inc.php"); |
|
4 |
|
|
5 |
if ($_GET["id"]) { |
37
|
6 |
// check if we have access to the given id |
|
7 |
$zoneId = recid_to_domid($_GET['id']); |
|
8 |
if ((!level(5)) && (!xs($zoneId))) { |
|
9 |
error(ERR_RECORD_ACCESS_DENIED); |
|
10 |
} |
|
11 |
if ((!level(5)) && ($_SESSION[$zoneId.'_ispartial'] == 1)) { |
|
12 |
$checkPartial = $db->queryOne("SELECT id FROM record_owners WHERE record_id='".$_GET["id"]."' AND user_id='".$_SESSION["userid"]."' LIMIT 1"); |
|
13 |
if (empty($checkPartial)) { |
|
14 |
error(ERR_RECORD_ACCESS_DENIED); |
|
15 |
} |
|
16 |
} |
1
|
17 |
if ($_GET["confirm"] == '0') { |
|
18 |
clean_page("edit.php?id=".$_GET["domain"]); |
|
19 |
} elseif ($_GET["confirm"] == '1') { |
|
20 |
delete_record($_GET["id"]); |
|
21 |
clean_page("edit.php?id=".$_GET["domain"]); |
|
22 |
} |
|
23 |
include_once("inc/header.inc.php"); |
13
|
24 |
?> |
|
25 |
|
|
26 |
<h2><? echo _('Delete record'); ?> "<? |
1
|
27 |
$data = get_record_from_id($_GET["id"]); |
|
28 |
print $data["name"]." IN ".$data["type"]." ".$data["content"]; |
13
|
29 |
?>"</h2><? |
1
|
30 |
if (($data["type"] == "NS" && $data["name"] == get_domain_name_from_id($_GET["domain"])) || $data["type"] == "SOA") { |
13
|
31 |
print "<font class=\"warning\">" . _('You are trying to delete a record that is needed for this zone to work.') . "</font><br>"; |
1
|
32 |
} |
13
|
33 |
?><br><font class="warning"><? echo _('Are you sure?'); ?></font><br><br> |
|
34 |
<input type="button" class="button" OnClick="location.href='<? echo $_SERVER["REQUEST_URI"] ?>&confirm=1'" value="<? echo _('Yes'); ?>"> |
|
35 |
<input type="button" class="button" OnClick="location.href='<? echo $_SERVER["REQUEST_URI"] ?>&confirm=0'" value="<? echo _('No'); ?>"> |
1
|
36 |
<? |
|
37 |
} else { |
|
38 |
include_once("inc/header.inc.php"); |
37
|
39 |
echo _("Nothing to do!"); |
1
|
40 |
} |
|
41 |
include_once("inc/footer.inc.php"); |