call_acl_delete.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Igor Olhovskiy <[email protected]>
  21. Call ACL is written on Call Block base by Gerrit Visser <[email protected]>
  22. */
  23. //includes
  24. include "root.php";
  25. require_once "resources/require.php";
  26. require_once "resources/check_auth.php";
  27. //check permissions
  28. if (permission_exists('call_acl_delete')) {
  29. //access granted
  30. } else {
  31. echo "access denied";
  32. exit;
  33. }
  34. //add multi-lingual support
  35. $language = new text;
  36. $text = $language->get();
  37. //set the variable
  38. if (count($_GET) > 0) {
  39. $id = $_GET["id"];
  40. }
  41. //delete the extension
  42. if (strlen($id) > 0) {
  43. //delete the call block
  44. $sql = "DELETE FROM v_call_acl";
  45. $sql .= " WHERE domain_uuid = '".$_SESSION['domain_uuid']."'";
  46. $sql .= " AND call_acl_uuid = '$id' ";
  47. $prep_statement = $db->prepare(check_sql($sql));
  48. $prep_statement->execute();
  49. unset($prep_statement, $sql);
  50. }
  51. //redirect the browser
  52. messages::add($text['label-delete-complete']);
  53. header("Location: call_acl.php");
  54. return;
  55. ?>