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"); |
82
|
23 |
include_once("inc/header.inc.php"); |
1
|
24 |
|
82
|
25 |
if (verify_permission(zone_content_edit_others)) { $perm_edit = "all" ; } |
|
26 |
elseif (verify_permission(zone_content_edit_own)) { $perm_edit = "own" ;} |
|
27 |
else { $perm_edit = "none" ; } |
|
28 |
|
|
29 |
$zone_id = "-1"; |
|
30 |
if (isset($_GET['id']) && v_num($_GET['id'])) { |
|
31 |
$zone_id = $_GET['id']; |
|
32 |
} |
|
33 |
|
|
34 |
$confirm = "-1"; |
|
35 |
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) { |
|
36 |
$confirm = $_GET['confirm']; |
|
37 |
} |
|
38 |
|
|
39 |
$zone_info = get_zone_info_from_id($zone_id); |
|
40 |
$zone_owners = get_fullnames_owners_from_domainid($zone_id); |
|
41 |
$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id); |
|
42 |
|
|
43 |
if ($zone_id == "-1"){ |
|
44 |
error(ERR_INV_INPUT); |
|
45 |
include_once("inc/footer.inc.php"); |
|
46 |
exit; |
1
|
47 |
} |
|
48 |
|
82
|
49 |
echo " <h2>" . _('Delete zone') . " \"" . $zone_info['name']. "\"</h2>\n"; |
|
50 |
|
|
51 |
if ($confirm == '1') { |
|
52 |
if ( delete_domain($zone_id) ) { |
|
53 |
success(SUC_ZONE_DEL); |
13
|
54 |
} |
82
|
55 |
} else { |
|
56 |
if ( $perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1") ) { |
|
57 |
echo " " . _('Owner') . ": " . $zone_owners . "<br>\n"; |
|
58 |
echo " " . _('Type') . ": " . $zone_info['type'] . "\n"; |
|
59 |
if ( $zone_info['type'] == "SLAVE" ) { |
|
60 |
$slave_master = get_domain_slave_master($zone_id); |
|
61 |
if(supermaster_exists($slave_master)) { |
|
62 |
echo " <p> \n"; |
|
63 |
printf (_('You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!'), $slave_master); |
|
64 |
echo " </p>\n"; |
|
65 |
} |
13
|
66 |
} |
82
|
67 |
echo " <p>" . _('Are you sure?') . "</p>\n"; |
|
68 |
echo " <br><br>\n"; |
|
69 |
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER["REQUEST_URI"] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n"; |
|
70 |
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n"; |
|
71 |
} else { |
|
72 |
error(ERR_PERM_DEL_ZONE); |
13
|
73 |
} |
1
|
74 |
} |
82
|
75 |
|
1
|
76 |
include_once("inc/footer.inc.php"); |
82
|
77 |
|
|
78 |
?> |