Update destination_delete.php
This commit is contained in:
@@ -17,22 +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-2015
|
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
||||||
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>
|
||||||
*/
|
*/
|
||||||
require_once "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
require_once "root.php";
|
||||||
if (permission_exists('destination_delete')) {
|
require_once "resources/require.php";
|
||||||
//access granted
|
require_once "resources/check_auth.php";
|
||||||
}
|
|
||||||
else {
|
//check permissions
|
||||||
echo "access denied";
|
if (permission_exists('destination_delete')) {
|
||||||
exit;
|
//access granted
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
@@ -54,11 +58,12 @@ else {
|
|||||||
$p = new permissions;
|
$p = new permissions;
|
||||||
$p->add($permission, 'temp');
|
$p->add($permission, 'temp');
|
||||||
|
|
||||||
//get the dialplan_uuid
|
//get the dialplan uuid and context
|
||||||
$orm = new orm;
|
$sql = "select * from v_destinations ";
|
||||||
$orm->name('destinations');
|
$sql .= "where destination_uuid = '$id' ";
|
||||||
$orm->uuid($id);
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
$result = $orm->find()->get();
|
$prep_statement->execute();
|
||||||
|
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
foreach ($result as &$row) {
|
foreach ($result as &$row) {
|
||||||
if (permission_exists('destination_domain')) {
|
if (permission_exists('destination_domain')) {
|
||||||
$domain_uuid = $row["domain_uuid"];
|
$domain_uuid = $row["domain_uuid"];
|
||||||
@@ -111,4 +116,4 @@ else {
|
|||||||
header("Location: destinations.php");
|
header("Location: destinations.php");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user