From a272f72b79161333d46bc127e126d64b6edd1882 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 13 Mar 2013 05:57:41 +0000 Subject: [PATCH] Fix a few a few settings that are required to add extension_uuid to xml cdr. --- app/extensions/extension_edit.php | 15 ++++++++------- app/extensions/resources/classes/extension.php | 1 + app/xml_cdr/v_xml_cdr_import.php | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 2869e5e46f..5778b91152 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -43,7 +43,7 @@ else { } //get the http values and set them as php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { //get the values from the HTTP POST and save them as PHP variables $extension = check_str($_POST["extension"]); $number_alias = check_str($_POST["number_alias"]); @@ -410,7 +410,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update" && permission_exists('extension_edit')) { if (strlen($password) == 0) { - $password = generate_password(); + $password = generate_password(12,4); } $sql = "update v_extensions set "; @@ -422,7 +422,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "vm_password = '$vm_password', "; } else { - $sql .= "vm_password = 'user-choose', "; + $sql .= "vm_password = '".generate_password(9, 1)."', "; } $sql .= "accountcode = '$accountcode', "; $sql .= "effective_caller_id_name = '$effective_caller_id_name', "; @@ -480,11 +480,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $db->exec(check_sql($sql)); unset($sql); - //syncrhonize configuration + //synchronize configuration if (is_readable($_SESSION['switch']['extensions']['dir'])) { - require_once "app/extensions/resources/extension.php"; - $extension = new extension; - $extension->xml(); + require_once "app/extensions/resources/classes/extension.php"; + $ext = new extension; + $ext->xml(); + unset($ext); } //write the provision files diff --git a/app/extensions/resources/classes/extension.php b/app/extensions/resources/classes/extension.php index cbd7ed2ccd..a71ada6da2 100644 --- a/app/extensions/resources/classes/extension.php +++ b/app/extensions/resources/classes/extension.php @@ -346,6 +346,7 @@ //apply settings $_SESSION["reload_xml"] = true; } + } } ?> \ No newline at end of file diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index d6765b3174..bbc8287d41 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -211,8 +211,8 @@ function process_xml_cdr($db, $leg, $xml_string) { } //insert the check_str($extension_uuid) - if (check_str($extension_uuid)) { - $database->fields['extension_uuid'] = check_str($extension_uuid); + if (strlen($xml->variables->extension_uuid) > 0) { + $database->fields['extension_uuid'] = check_str(urldecode($xml->variables->extension_uuid)); } //insert xml_cdr into the db