From 2aa37f94ce64b2264cd192bf7bf970055251138d Mon Sep 17 00:00:00 2001 From: luis daniel lucio quiroz Date: Thu, 30 Apr 2015 13:45:13 +0000 Subject: [PATCH] change the Billing when you change the Tenant name --- core/domain_settings/domain_edit.php | 13 ++++++++++++- core/domain_settings/domain_settings.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/domain_settings/domain_edit.php b/core/domain_settings/domain_edit.php index ec80a7ef97..e95d020e5a 100644 --- a/core/domain_settings/domain_edit.php +++ b/core/domain_settings/domain_edit.php @@ -22,6 +22,7 @@ Contributor(s): Mark J Crane + Luis Daniel Lucio Quiroz */ require_once "root.php"; require_once "resources/require.php"; @@ -182,6 +183,16 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $db->exec(check_sql($sql)); unset($sql); + // update billing, if installed + if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ + $sql = "update v_billings set "; + $sql .= "type_value = '".$domain_name."' "; + $sql .= "where type_value = '".$original_domain_name."' "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } + // rename switch/storage/voicemail/default/[domain] (folder) if ( isset($_SESSION['switch']['voicemail']['dir']) && file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$original_domain_name) ) { @rename($_SESSION['switch']['voicemail']['dir']."/default/".$original_domain_name, $_SESSION['switch']['voicemail']['dir']."/default/".$domain_name); // folder @@ -702,4 +713,4 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> diff --git a/core/domain_settings/domain_settings.php b/core/domain_settings/domain_settings.php index 5f273f9850..e8a4671261 100644 --- a/core/domain_settings/domain_settings.php +++ b/core/domain_settings/domain_settings.php @@ -306,4 +306,4 @@ if (sizeof($_REQUEST) > 1) { //include the footer //require_once "resources/footer.php"; -?> \ No newline at end of file +?>