servers_delete.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. require_once "root.php";
  22. require_once "resources/require.php";
  23. require_once "resources/check_auth.php";
  24. if (if_group("admin") || if_group("superadmin")) {
  25. //access granted
  26. }
  27. else {
  28. echo "access denied";
  29. exit;
  30. }
  31. if (count($_GET)>0) {
  32. $id = check_str($_GET["id"]);
  33. }
  34. if (strlen($id)>0) {
  35. $sql = "delete from v_servers ";
  36. $sql .= "where domain_uuid = '$domain_uuid' ";
  37. $sql .= "and server_uuid = '$id' ";
  38. $prep_statement = $db->prepare(check_sql($sql));
  39. $prep_statement->execute();
  40. unset($sql);
  41. }
  42. require_once "resources/header.php";
  43. echo "<meta http-equiv=\"refresh\" content=\"2;url=servers.php\">\n";
  44. echo "<div align='center'>\n";
  45. echo "Delete Complete\n";
  46. echo "</div>\n";
  47. require_once "resources/footer.php";
  48. return;
  49. ?>