Update phrase_delete.php

This commit is contained in:
FusionPBX
2019-02-05 10:39:17 -07:00
committed by GitHub
parent 1613627a78
commit 9a2a255fac
+22 -13
View File
@@ -17,24 +17,26 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012 Portions created by the Initial Developer are Copyright (C) 2008-2018
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
*/ */
include "root.php"; //includes
require_once "resources/require.php"; include "root.php";
require_once "resources/check_auth.php"; require_once "resources/require.php";
require_once "resources/functions/save_phrases_xml.php"; require_once "resources/check_auth.php";
require_once "resources/functions/save_phrases_xml.php";
if (permission_exists('phrase_delete')) { //check permissions
if (permission_exists('phrase_delete')) {
//access granted //access granted
} }
else { else {
echo "access denied"; echo "access denied";
exit; exit;
} }
//add multi-lingual support //add multi-lingual support
$language = new text; $language = new text;
@@ -43,7 +45,8 @@ else {
//get values //get values
$phrase_uuid = $_GET["id"]; $phrase_uuid = $_GET["id"];
if ($phrase_uuid != '') { //delete the data
if (is_uuid($phrase_uuid)) {
//delete phrase details //delete phrase details
$sql = "delete from v_phrase_details "; $sql = "delete from v_phrase_details ";
$sql .= "where phrase_uuid = '".$phrase_uuid."' "; $sql .= "where phrase_uuid = '".$phrase_uuid."' ";
@@ -60,12 +63,18 @@ if ($phrase_uuid != '') {
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement); unset ($prep_statement);
} }
save_phrases_xml(); //save the xml
save_phrases_xml();
//clear the cache
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
$cache = new cache;
$cache->delete("languages:".$phrase_language);
//redirect the user //redirect the user
message::add($text['message-delete']); message::add($text['message-delete']);
header("Location: phrases.php"); header("Location: phrases.php");
return;
?> ?>