From 745bc6479e0d17ccb5138155691fdd0d0cfa8cdb Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 14 Oct 2016 08:13:40 -0600 Subject: [PATCH] Update dialplan_outbound_add.php --- .../dialplan_outbound_add.php | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index bba0e20b56..ec65217344 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - 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): @@ -26,16 +26,20 @@ Riccardo Granchi Gill Abada */ -include "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -if (permission_exists('outbound_route_add')) { - //access granted -} -else { - echo "access denied"; - exit; -} + +//includes + include "root.php"; + require_once "resources/require.php"; + require_once "resources/check_auth.php"; + +//check permissions + if (permission_exists('outbound_route_add')) { + //access granted + } + else { + echo "access denied"; + exit; + } //add multi-lingual support $language = new text; @@ -154,7 +158,7 @@ else { } //process the http form values - if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { + if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //check for all required data if (strlen($gateway) == 0) { $msg .= $text['message-provide'].": ".$text['label-gateway-name']."
\n"; } //if (strlen($gateway_2) == 0) { $msg .= "Please provide: Alternat 1
\n"; } @@ -179,7 +183,7 @@ else { return; } - if (strlen(trim($_POST['dialplan_expression']))> 0) { + if (strlen(trim($_POST['dialplan_expression'])) > 0) { $tmp_array = explode("\n", $_POST['dialplan_expression']); @@ -551,6 +555,13 @@ else { } //end for each } + //update the dialplan xml + $dialplans = new dialplan; + $dialplans->source = "details"; + $dialplans->destination = "database"; + $dialplans->uuid = $dialplan_uuid; + $dialplans->xml(); + //clear the cache $cache = new cache; $cache->delete("dialplan:".$dialplan_context); @@ -1026,4 +1037,4 @@ function type_onchange(dialplan_detail_type) { //show the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?>