From f80e2c5d3c4c17c803442825faa473f614aeacdb Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 30 Apr 2015 01:17:47 +0000 Subject: [PATCH] Add dialplan add temporary permissions. --- app/destinations/destination_edit.php | 4 ++++ app/time_conditions/time_condition_edit.php | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 2cbd0525f2..9fcf6629cc 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -376,6 +376,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //add the dialplan permission $p = new permissions; + $p->add("dialplan_add", 'temp'); + $p->add("dialplan_detail_add", 'temp'); $p->add("dialplan_edit", 'temp'); $p->add("dialplan_detail_edit", 'temp'); @@ -389,6 +391,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $dialplan_response = $orm->message; //remove the temporary permission + $p->delete("dialplan_add", 'temp'); + $p->delete("dialplan_detail_add", 'temp'); $p->delete("dialplan_edit", 'temp'); $p->delete("dialplan_detail_edit", 'temp'); diff --git a/app/time_conditions/time_condition_edit.php b/app/time_conditions/time_condition_edit.php index c23cc4264d..8c1541e20d 100644 --- a/app/time_conditions/time_condition_edit.php +++ b/app/time_conditions/time_condition_edit.php @@ -452,9 +452,11 @@ require_once "resources/header.php"; if ($dialplan_uuid != '' && $_POST["persistformvar"] != "true") { //add the dialplan permission - $permission = "dialplan_edit"; $p = new permissions; - $p->add($permission, 'temp'); + $p->add("dialplan_add", 'temp'); + $p->add("dialplan_detail_add", 'temp'); + $p->add("dialplan_edit", 'temp'); + $p->add("dialplan_detail_edit", 'temp'); //get main dialplan entry $orm = new orm; @@ -476,7 +478,10 @@ require_once "resources/header.php"; unset ($prep_statement); //remove the temporary permission - $p->delete($permission, 'temp'); + $p->delete("dialplan_add", 'temp'); + $p->delete("dialplan_detail_add", 'temp'); + $p->delete("dialplan_edit", 'temp'); + $p->delete("dialplan_detail_edit", 'temp'); //get dialplan detail conditions $sql = "select dialplan_detail_group, dialplan_detail_tag, dialplan_detail_type, dialplan_detail_data from v_dialplan_details ";