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_perm_templ.php 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 permission 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('templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0";
  33. $permission_templates = list_permission_templates();
  34. if ($perm_templ_perm_edit == "0") {
  35. error(ERR_PERM_EDIT_PERM_TEMPL);
  36. } else {
  37. echo " <h2>" . _('Permission templates') . "</h2>\n";
  38. echo " <table>\n";
  39. echo " <tr>\n";
  40. echo " <th>&nbsp;</th>\n";
  41. echo " <th>" . _('Name') . "</th>\n";
  42. echo " <th>" . _('Description') . "</th>\n";
  43. echo " </tr>\n";
  44. foreach ($permission_templates as $template) {
  45. $perm_item_list = get_permissions_by_template_id($template['id'], true);
  46. $perm_items = implode(', ', $perm_item_list);
  47. echo " <tr>\n";
  48. if ($perm_templ_perm_edit == "1") {
  49. echo " <td>\n";
  50. echo " <a href=\"edit_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . " ]\"></a>\n";
  51. echo " <a href=\"delete_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . " ]\"></a>\n";
  52. echo " </td>\n";
  53. } else {
  54. echo " <td>&nbsp;</td>\n";
  55. }
  56. echo " <td class=\"y\">" . $template['name'] . "</td>\n";
  57. echo " <td class=\"y\">" . $template['descr'] . "</td>\n";
  58. echo " </tr>\n";
  59. }
  60. echo " </table>\n";
  61. echo " <ul>\n";
  62. echo " <li><a href=\"add_perm_templ.php\">" . _('Add permission template') . "</a>.</li>\n";
  63. echo " </ul>\n";
  64. }
  65. include_once("inc/footer.inc.php");