Update destination_delete.php

This commit is contained in:
FusionPBX
2016-10-22 23:14:28 -06:00
committed by GitHub
parent 19e914c422
commit ea9d308eea

View File

@@ -17,22 +17,26 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2015
Portions created by the Initial Developer are Copyright (C) 2008-2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('destination_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//includes
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//check permissions
if (permission_exists('destination_delete')) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
@@ -54,11 +58,12 @@ else {
$p = new permissions;
$p->add($permission, 'temp');
//get the dialplan_uuid
$orm = new orm;
$orm->name('destinations');
$orm->uuid($id);
$result = $orm->find()->get();
//get the dialplan uuid and context
$sql = "select * from v_destinations ";
$sql .= "where destination_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
if (permission_exists('destination_domain')) {
$domain_uuid = $row["domain_uuid"];
@@ -111,4 +116,4 @@ else {
header("Location: destinations.php");
return;
?>
?>