13
|
1 |
<?php |
47
|
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 |
|
82
|
25 |
$master_ip = $_POST["master_ip"]; |
|
26 |
$ns_name = $_POST["ns_name"]; |
|
27 |
$account = $_POST["account"]; |
13
|
28 |
|
82
|
29 |
(verify_permission(supermaster_add)) ? $supermasters_add = "1" : $supermasters_add = "0"; |
|
30 |
|
|
31 |
if($_POST["submit"]) |
13
|
32 |
{ |
82
|
33 |
if (add_supermaster($master_ip, $ns_name, $account)) { |
110
|
34 |
success(SUC_SM_ADD); |
82
|
35 |
} else { |
|
36 |
$error = "1"; |
13
|
37 |
} |
|
38 |
} |
|
39 |
|
82
|
40 |
echo " <h2>" . _('Add supermaster') . "</h2>\n"; |
|
41 |
|
|
42 |
if ( $supermasters_add != "1" ) { |
|
43 |
echo " <p>" . _("You do not have the permission to add a new supermaster.") . "</p>\n"; |
|
44 |
} else { |
|
45 |
echo " <form method=\"post\" action=\"add_supermaster.php\">\n"; |
|
46 |
echo " <table>\n"; |
|
47 |
echo " <tr>\n"; |
|
48 |
echo " <td class=\"n\">" . _('IP address of supermaster') . "</td>\n"; |
|
49 |
echo " <td class=\"n\">\n"; |
|
50 |
if ($error) { |
|
51 |
echo " <input type=\"text\" class=\"input\" name=\"master_ip\" value=\"" . $master_ip . "\">\n"; |
|
52 |
} else { |
|
53 |
echo " <input type=\"text\" class=\"input\" name=\"master_ip\" value=\"\">\n"; |
|
54 |
} |
|
55 |
echo " </td>\n"; |
|
56 |
echo " </tr>\n"; |
|
57 |
echo " <tr>\n"; |
|
58 |
echo " <td class=\"n\">" . _('Hostname in NS record') . "</td>\n"; |
|
59 |
echo " <td class=\"n\">\n"; |
|
60 |
if ($error) { |
|
61 |
echo " <input type=\"text\" class=\"input\" name=\"ns_name\" value=\"" . $ns_name . "\">\n"; |
|
62 |
} else { |
|
63 |
echo " <input type=\"text\" class=\"input\" name=\"ns_name\" value=\"\">\n"; |
|
64 |
} |
|
65 |
echo " </td>\n"; |
|
66 |
echo " </tr>\n"; |
|
67 |
echo " <tr>\n"; |
|
68 |
echo " <td class=\"n\">" . _('Account') . "</td>\n"; |
|
69 |
echo " <td class=\"n\">\n"; |
|
70 |
if ($error) { |
|
71 |
echo " <input type=\"text\" class=\"input\" name=\"account\" value=\"" . $account . "\">\n"; |
|
72 |
} else { |
|
73 |
echo " <input type=\"text\" class=\"input\" name=\"account\" value=\"\">\n"; |
|
74 |
} |
|
75 |
echo " </td>\n"; |
|
76 |
echo " </tr>\n"; |
|
77 |
echo " <tr>\n"; |
|
78 |
echo " <td class=\"n\"> </td>\n"; |
|
79 |
echo " <td class=\"n\">\n"; |
|
80 |
echo " <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add supermaster') . "\">\n"; |
|
81 |
echo " </td>\n"; |
|
82 |
echo " </tr>\n"; |
|
83 |
echo " </table>\n"; |
|
84 |
echo " </form>\n"; |
|
85 |
} |
13
|
86 |
include_once("inc/footer.inc.php"); |
|
87 |
?> |