You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list_supermasters.php 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /* Poweradmin, a friendly web-based admin tool for PowerDNS.
  3. * See <http://www.poweradmin.org> for more details.
  4. *
  5. * Copyright 2007-2010 Rejo Zenger <rejo@zenger.nl>
  6. * Copyright 2010-2017 Poweradmin Development Team
  7. * <http://www.poweradmin.org/credits.html>
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. /**
  23. * Script that displays supermasters list
  24. *
  25. * @package Poweradmin
  26. * @copyright 2007-2010 Rejo Zenger <rejo@zenger.nl>
  27. * @copyright 2010-2017 Poweradmin Development Team
  28. * @license http://opensource.org/licenses/GPL-3.0 GPL
  29. */
  30. require_once("inc/toolkit.inc.php");
  31. include_once("inc/header.inc.php");
  32. (do_hook('verify_permission', 'supermaster_view')) ? $perm_sm_view = "1" : $perm_sm_view = "0";
  33. (do_hook('verify_permission', 'supermaster_edit')) ? $perm_sm_edit = "1" : $perm_sm_edit = "0";
  34. $supermasters = get_supermasters();
  35. $num_supermasters = ($supermasters == -1) ? 0 : count($supermasters);
  36. echo " <h2>" . _('List supermasters') . "</h2>\n";
  37. echo " <table>\n";
  38. echo " <tr>\n";
  39. echo " <th>&nbsp;</th>\n";
  40. echo " <th>" . _('IP address of supermaster') . "</th>\n";
  41. echo " <th>" . _('Hostname in NS record') . "</th>\n";
  42. echo " <th>" . _('Account') . "</th>\n";
  43. echo " </tr>\n";
  44. if ($num_supermasters == "0") {
  45. echo " <tr>\n";
  46. echo " <td class=\"n\">&nbsp;</td>\n";
  47. echo " <td class=\"n\" colspan=\"3\">\n";
  48. echo " " . _('There are no zones to show in this listing.') . "\n";
  49. echo " </td>\n";
  50. echo " </tr>\n";
  51. } else {
  52. foreach ($supermasters as $c) {
  53. echo " <tr>\n";
  54. if ($perm_sm_edit == "1") {
  55. echo " <td class=\"n\"><a href=\"delete_supermaster.php?master_ip=" . $c['master_ip'] . "&amp;ns_name=" . $c['ns_name'] . "\"><img src=\"images/delete.gif\" title=\"" . _('Delete supermaster') . ' ' . $c['master_ip'] . "\" alt=\"[ " . _('Delete supermaster') . " ]\"></a></td>\n";
  56. } else {
  57. echo "<td>&nbsp;</td>\n";
  58. }
  59. echo " <td class=\"y\">" . $c['master_ip'] . "</td>\n";
  60. echo " <td class=\"y\">" . $c['ns_name'] . "</td>\n";
  61. echo " <td class=\"y\">" . $c['account'] . "</td>\n";
  62. echo " </tr>\n";
  63. }
  64. }
  65. echo " </table>\n";
  66. include_once("inc/footer.inc.php");