13
|
1 |
<?php |
|
2 |
|
119
|
3 |
/* Poweradmin, a friendly web-based admin tool for PowerDNS. |
47
|
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 |
|
13
|
22 |
require_once("inc/toolkit.inc.php"); |
82
|
23 |
include_once("inc/header.inc.php"); |
13
|
24 |
|
106
|
25 |
$master_ip = "-1"; |
82
|
26 |
if (isset($_GET['master_ip']) && (is_valid_ip($_GET['master_ip']) || is_valid_ip6($_GET['master_ip']))) { |
|
27 |
$master_ip = $_GET['master_ip']; |
|
28 |
} |
|
29 |
|
|
30 |
$confirm = "-1"; |
106
|
31 |
if ((isset($_GET['confirm'])) && (v_num($_GET['confirm']))) { |
82
|
32 |
$confirm = $_GET['confirm']; |
13
|
33 |
} |
|
34 |
|
82
|
35 |
if ($master_ip == "-1"){ |
|
36 |
error(ERR_INV_INPUT); |
13
|
37 |
} else { |
126
|
38 |
(verify_permission('supermaster_edit')) ? $perm_sm_edit = "1" : $perm_sm_edit = "0" ; |
82
|
39 |
if ($perm_sm_edit == "0") { |
|
40 |
error(ERR_PERM_DEL_SM); |
|
41 |
} else { |
|
42 |
$info = get_supermaster_info_from_ip($master_ip); |
|
43 |
|
|
44 |
echo " <h2>" . _('Delete supermaster') . " \"" . $master_ip . "\"</h2>\n"; |
|
45 |
|
|
46 |
if ($_GET["confirm"] == '1') { |
|
47 |
if (delete_supermaster($master_ip)) { |
|
48 |
success(SUC_ZONE_DEL); |
|
49 |
} |
|
50 |
} else { |
|
51 |
echo " <p>\n"; |
|
52 |
echo " " . _('Hostname in NS record') . ": " . $info['ns_name'] . "<br>\n"; |
|
53 |
echo " " . _('Account') . ": " . $info['account'] . "\n"; |
|
54 |
echo " </p>\n"; |
|
55 |
echo " <p>" . _('Are you sure?') . "</p>\n"; |
|
56 |
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER['REQUEST_URI'] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n"; |
|
57 |
echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n"; |
|
58 |
} |
|
59 |
} |
13
|
60 |
} |
82
|
61 |
|
13
|
62 |
include_once("inc/footer.inc.php"); |