voicemail_prefs_delete.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "resources/require.php";
  23. require_once "resources/check_auth.php";
  24. if (permission_exists('voicemail_status_delete')) {
  25. //access granted
  26. }
  27. else {
  28. echo "access denied";
  29. exit;
  30. }
  31. if (count($_GET)>0) {
  32. $id = $_GET["id"];
  33. }
  34. //pdo voicemail database connection
  35. include "resources/pdo_vm.php";
  36. //delete the data
  37. if (strlen($id)>0) {
  38. $sql = "delete from voicemail_prefs ";
  39. $sql .= "where domain = '".$_SESSION['domains'][$domain_uuid]['domain_name']."' ";
  40. $sql .= "and username = '$domain_uuid' ";
  41. $count = $db->exec(check_sql($sql));
  42. unset($sql);
  43. }
  44. //add multi-lingual support
  45. $language = new text;
  46. $text = $language->get();
  47. //redirect the user
  48. require "resources/require.php";
  49. require_once "resources/header.php";
  50. echo "<meta http-equiv=\"refresh\" content=\"2;url=voicemail.php\">\n";
  51. echo "<div align='center'>\n";
  52. echo $text['label-prefs-delete']."\n";
  53. echo "</div>\n";
  54. require_once "resources/footer.php";
  55. return;
  56. ?>