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.

delete_zone_templ_record.php 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 record deletion from zone template
  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. $record_id = "-1";
  33. if (isset($_GET['id']) && v_num($_GET['id'])) {
  34. $record_id = $_GET['id'];
  35. }
  36. $zone_templ_id = "-1";
  37. if (isset($_GET['zone_templ_id']) && v_num($_GET['zone_templ_id'])) {
  38. $zone_templ_id = $_GET['zone_templ_id'];
  39. }
  40. $confirm = "-1";
  41. if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
  42. $confirm = $_GET['confirm'];
  43. }
  44. if ($record_id == "-1" || $zone_templ_id == "-1") {
  45. error(ERR_INV_INPUT);
  46. } else {
  47. $owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
  48. if ($confirm == '1' && $owner) {
  49. if (delete_zone_templ_record($record_id)) {
  50. success(SUC_RECORD_DEL);
  51. }
  52. } else {
  53. $templ_details = get_zone_templ_details($zone_templ_id);
  54. $record_info = get_zone_templ_record_from_id($record_id);
  55. echo " <h2>" . _('Delete record in zone') . " \"" . $templ_details['name'] . "\"</h2>\n";
  56. if (!(verify_permission('zone_master_add')) || !$owner) {
  57. error(ERR_PERM_DEL_RECORD);
  58. } else {
  59. echo " <table>\n";
  60. echo " <tr>\n";
  61. echo " <th>Name</th>\n";
  62. echo " <th>Type</th>\n";
  63. echo " <th>Content</th>\n";
  64. echo " <th>Priority</th>\n";
  65. echo " <th>TTL</th>\n";
  66. echo " </tr>\n";
  67. echo " <tr>\n";
  68. echo " <td>" . $record_info['name'] . "</td>\n";
  69. echo " <td>" . $record_info['type'] . "</td>\n";
  70. echo " <td>" . $record_info['content'] . "</td>\n";
  71. echo " <td>" . $record_info['prio'] . "</td>\n";
  72. echo " <td>" . $record_info['ttl'] . "</td>\n";
  73. echo " </tr>\n";
  74. echo " </table>\n";
  75. echo " <p>" . _('Are you sure?') . "</p>\n";
  76. echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ_record.php?id=" . $record_id . "&amp;zone_templ_id=" . $zone_templ_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
  77. echo " <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
  78. }
  79. }
  80. }
  81. include_once("inc/footer.inc.php");