Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('voicemail_message_delete')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //get the HTTP values and set them as variables if (count($_GET)>0) { $id = check_str($_GET["id"]); $voicemail_uuid = check_str($_GET["voicemail_uuid"]); } //set the referrer $http_referer = parse_url($_SERVER["HTTP_REFERER"]); $referer_path = $http_referer['path']; $referer_query = $http_referer['query']; //delete the voicemail message if (strlen($id)>0) { require_once "resources/classes/voicemail.php"; $voicemail = new voicemail; $voicemail->db = $db; $voicemail->domain_uuid = $_SESSION['domain_uuid']; $voicemail->voicemail_uuid = $voicemail_uuid; $voicemail->voicemail_message_uuid = $id; $result = $voicemail->message_delete(); unset($voicemail); } //redirect the user $_SESSION["message"] = $text['message-delete']; if ($referer_path == "/app/voicemails/voicemail_messages.php") { header("Location: voicemail_messages.php?".$referer_query); } else { header("Location: voicemails.php"); } return; ?>