From b5f85d43caabaf6726d7aa334fd21593fdd0135a Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 26 Oct 2020 18:07:40 -0600 Subject: [PATCH] Update dialplan_outbound_add.php Adjust permissions to work better for admin if the outbound_route_add permissions is set. --- .../dialplan_outbound_add.php | 96 ++++++++++--------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 7ee05958d5..b33f058583 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -684,6 +684,11 @@ } //end foreach } + //add the dialplan permission + $p = new permissions; + $p->add("dialplan_add", "temp"); + $p->add("dialplan_detail_add", "temp"); + //save to the data $database = new database; $database->app_name = 'outbound_routes'; @@ -699,6 +704,10 @@ $dialplans->uuid = $dialplan_uuid; $dialplans->xml(); + //remove the temporary permission + $p->delete("dialplan_add", "temp"); + $p->delete("dialplan_detail_add", "temp"); + //clear the cache $cache = new cache; $cache->delete("dialplan:".$dialplan_context); @@ -806,50 +815,49 @@ function type_onchange(dialplan_detail_type) { echo "\n"; echo "\n"; - if (if_group("superadmin")) { - echo "\n"; - echo "\n"; - } + echo "\n"; + echo "\n"; + //set the onchange $onchange = '';