Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

add_perm_templ.php 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 handles requests to add new permission template
  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. if (!do_hook('verify_permission' , 'templ_perm_edit' )) {
  33. error(ERR_PERM_EDIT_PERM_TEMPL);
  34. } else {
  35. if (isset($_POST['commit'])) {
  36. do_hook('add_perm_templ', $_POST );
  37. success(SUC_PERM_TEMPL_ADD);
  38. }
  39. $perms_avail = do_hook('get_permissions_by_template_id');
  40. /*
  41. Display new permission form
  42. */
  43. echo " <h2>" . _('Add permission template') . "</h2>\n";
  44. echo " <form method=\"post\" action=\"\">\n";
  45. echo " <table>\n";
  46. echo " <tr>\n";
  47. echo " <th>" . _('Name') . "</th>\n";
  48. echo " <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
  49. echo " </tr>\n";
  50. echo " <tr>\n";
  51. echo " <th>" . _('Description') . "</th>\n";
  52. echo " <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
  53. echo " </tr>\n";
  54. echo " </table>\n";
  55. echo " <table>\n";
  56. echo " <tr>\n";
  57. echo " <th>&nbsp;</th>\n";
  58. echo " <th>" . _('Name') . "</th>\n";
  59. echo " <th>" . _('Description') . "</th>\n";
  60. echo " </tr>\n";
  61. /*
  62. Display available permissions settings for inclusion
  63. in the new permission
  64. */
  65. foreach ($perms_avail as $perm_a) {
  66. echo " <tr>\n";
  67. echo " <td><input type=\"checkbox\" name=\"perm_id[]\" value=\"" . $perm_a['id'] . "\"></td>\n";
  68. echo " <td>" . $perm_a['name'] . "</td>\n";
  69. echo " <td>" . _($perm_a['descr']) . "</td>\n";
  70. echo " </tr>\n";
  71. }
  72. echo " </table>\n";
  73. echo " <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
  74. echo " </form>\n";
  75. }
  76. include_once("inc/footer.inc.php");