From 0b070904602845ff1e3b7a3ccb2dd1dac7a66d63 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 18 Jun 2018 14:19:15 -0600 Subject: [PATCH] Update domain_edit.php --- core/domain_settings/domain_edit.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/domain_settings/domain_edit.php b/core/domain_settings/domain_edit.php index 4e2346549f..eb1c0e24ae 100644 --- a/core/domain_settings/domain_edit.php +++ b/core/domain_settings/domain_edit.php @@ -145,12 +145,27 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { // update dialplans if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplans/app_config.php")){ - $sql = "update v_dialplans set "; - $sql .= "dialplan_context = '".$domain_name."' "; + $sql = "update v_dialplans "; + $sql .= "set dialplan_context = '".$domain_name."' "; $sql .= "where dialplan_context = '".$original_domain_name."' "; $sql .= "and domain_uuid = '".$domain_uuid."' "; $db->exec(check_sql($sql)); unset($sql); + + $sql = "update v_dialplans "; + $sql .= "set dialplan_xml = replace(dialplan_xml, $original_domain_name, $domain_name); "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } + + // update destinations + if (file_exists($_SERVER["PROJECT_ROOT"]."/app/destinations/app_config.php")){ + $sql = "update v_destinations "; + $sql .= "set destination_data = replace(destination_data, $original_domain_name, $domain_name); "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); } // update extensions (accountcode, user_context, dial_domain) @@ -717,4 +732,5 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //include the footer require_once "resources/footer.php"; + ?>