hunt_group_destination_delete.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. include "root.php";
  22. require_once "resources/require.php";
  23. require_once "resources/check_auth.php";
  24. //check permissions
  25. if (permission_exists('hunt_group_delete')) {
  26. //access granted
  27. }
  28. else {
  29. echo "access denied";
  30. exit;
  31. }
  32. //add multi-lingual support
  33. $language = new text;
  34. $text = $language->get();
  35. if (count($_GET)>0) {
  36. $id = $_GET["id"];
  37. $hunt_group_uuid = check_str($_REQUEST["id2"]);
  38. }
  39. if (strlen($id)>0) {
  40. //delete the data
  41. $sql = "delete from v_hunt_group_destinations ";
  42. $sql .= "where domain_uuid = '$domain_uuid' ";
  43. $sql .= "and hunt_group_destination_uuid = '$id' ";
  44. $sql .= "and hunt_group_uuid = '$hunt_group_uuid' ";
  45. $prep_statement = $db->prepare(check_sql($sql));
  46. $prep_statement->execute();
  47. unset($sql);
  48. //synchronize the xml config
  49. save_hunt_group_xml();
  50. }
  51. //redirect the user
  52. require_once "resources/header.php";
  53. echo "<meta http-equiv=\"refresh\" content=\"2;url=hunt_group_edit.php?id=".$hunt_group_uuid."\">\n";
  54. echo "<div align='center'>\n";
  55. echo $text['message-delete']."\n";
  56. echo "</div>\n";
  57. require_once "resources/footer.php";
  58. return;
  59. ?>