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
1 changed files with 41 additions and 32 deletions

View File

@ -17,17 +17,19 @@
The Initial Developer of the Original Code is
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.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
require_once "resources/functions/save_phrases_xml.php";
//check permissions
if (permission_exists('phrase_delete')) {
//access granted
}
@ -43,7 +45,8 @@ else {
//get values
$phrase_uuid = $_GET["id"];
if ($phrase_uuid != '') {
//delete the data
if (is_uuid($phrase_uuid)) {
//delete phrase details
$sql = "delete from v_phrase_details ";
$sql .= "where phrase_uuid = '".$phrase_uuid."' ";
@ -62,10 +65,16 @@ if ($phrase_uuid != '') {
unset ($prep_statement);
}
//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
message::add($text['message-delete']);
header("Location: phrases.php");
return;
?>