After removing domain name from the default recordings dir path need to add the domain name every where the recordings directory is currently used.

This commit is contained in:
markjcrane
2015-12-06 13:37:35 -07:00
parent 37d4f52dc8
commit ff8b838b5e
32 changed files with 92 additions and 105 deletions

View File

@@ -109,8 +109,8 @@ if ($domains_processed == 1) {
foreach ($result as &$row) {
$phrase_detail_uuid = $row['phrase_detail_uuid'];
$phrase_detail_data = $row['phrase_detail_data'];
if (substr_count($phrase_detail_data, $_SESSION['switch']['recordings']['dir']) > 0) {
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/', '', $phrase_detail_data);
if (substr_count($phrase_detail_data, $_SESSION['switch']['recordings']['dir'].'/'.$domain_name) > 0) {
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/', '', $phrase_detail_data);
}
//update function and data to be base64 compatible
$phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")";
@@ -141,7 +141,7 @@ if ($domains_processed == 1) {
$phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data);
$phrase_detail_data = str_replace(')', '', $phrase_detail_data);
if (substr_count($phrase_detail_data, '/') === 0) {
$phrase_detail_data = $_SESSION['switch']['recordings']['dir'].'/'.$phrase_detail_data;
$phrase_detail_data = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/'.$phrase_detail_data;
}
$sql = "update v_phrase_details set ";
$sql .= "phrase_detail_function = 'play-file', ";

View File

@@ -305,7 +305,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"lua(streamfile.lua ".$row["recording_filename"].")\"));\n";
}
else {
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"".$_SESSION['switch']['recordings']['dir'].'/'.$row["recording_filename"]."\"));\n";
echo "opt_group.appendChild(new Option(\"".$row["recording_name"]."\", \"".$_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row["recording_filename"]."\"));\n";
}
}
echo "obj_action.appendChild(opt_group);\n";
@@ -470,7 +470,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
if ($field['phrase_detail_function'] == 'play-file') {
$phrase_detail_function = $text['label-play'];
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/', '', $field['phrase_detail_data']);
$phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/', '', $field['phrase_detail_data']);
}
echo "<tr>\n";
echo " <td class='vtable'>".$phrase_detail_function."&nbsp;</td>\n";