From b2a6a67f811c9cffb6da99cb4682501ddd1c5f91 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Tue, 8 Jul 2014 06:47:52 +0000 Subject: [PATCH] Domain Edit: On Domain rename, update CDR records where appropriate. --- core/domain_settings/domain_edit.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/domain_settings/domain_edit.php b/core/domain_settings/domain_edit.php index cf5c9137b7..f5a603378d 100644 --- a/core/domain_settings/domain_edit.php +++ b/core/domain_settings/domain_edit.php @@ -156,6 +156,21 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "and domain_uuid = '".$domain_uuid."' "; $db->exec(check_sql($sql)); unset($sql); + + // update cdr records (domain_name, context) + $sql = "update v_xml_cdr set "; + $sql .= "domain_name = '".$domain_name."' "; + $sql .= "where domain_name = '".$current_domain_name."' "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + + $sql = "update v_xml_cdr set "; + $sql .= "context = '".$domain_name."' "; + $sql .= "where context = '".$current_domain_name."' "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); } //upgrade the domains