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_zone_templ.php 2.8KB

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-2014 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 list of zone templates
  24. *
  25. * @package Poweradmin
  26. * @copyright 2007-2010 Rejo Zenger <rejo@zenger.nl>
  27. * @copyright 2010-2014 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. verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
  33. $zone_templ = get_list_zone_templ($_SESSION['userid']);
  34. $username = get_fullname_from_userid($_SESSION['userid']);
  35. if ($perm_zone_master_add == "0") {
  36. error(ERR_PERM_EDIT_ZONE_TEMPL);
  37. } else {
  38. echo " <h2>" . _('Zone templates for') . " " . $username . "</h2>\n";
  39. echo " <table>\n";
  40. echo " <tr>\n";
  41. echo " <th>&nbsp;</th>\n";
  42. echo " <th>" . _('Name') . "</th>\n";
  43. echo " <th>" . _('Description') . "</th>\n";
  44. echo " </tr>\n";
  45. foreach ($zone_templ as $template) {
  46. echo " <tr>\n";
  47. if ($perm_zone_master_add == "1") {
  48. echo " <td>\n";
  49. echo " <a href=\"edit_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . " ]\"></a>\n";
  50. echo " <a href=\"delete_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . " ]\"></a>\n";
  51. echo " </td>\n";
  52. } else {
  53. echo " <td>&nbsp;</td>\n";
  54. }
  55. echo " <td class=\"y\">" . $template['name'] . "</td>\n";
  56. echo " <td class=\"y\">" . $template['descr'] . "</td>\n";
  57. echo " </tr>\n";
  58. }
  59. echo " </table>\n";
  60. echo " <ul>\n";
  61. echo " <li><a href=\"add_zone_templ.php\">" . _('Add zone template') . "</a>.</li>\n";
  62. echo " </ul>\n";
  63. }
  64. include_once("inc/footer.inc.php");