Update fax_edit.php

This commit is contained in:
FusionPBX 2018-06-02 23:17:13 -06:00 committed by GitHub
parent 4a6c42c8b9
commit fc3ea396ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 31 deletions

View File

@ -397,7 +397,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$fax_uuid = check_str($_GET["id"]);
$sql = "select * from v_fax ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and fax_uuid = '$fax_uuid' ";
$sql .= "and fax_uuid = '".$fax_uuid."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@ -485,7 +485,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-email']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='email' name='fax_email' maxlength='255' value=\"$fax_email\">\n";
echo " <input class='formfld' type='email' name='fax_email' maxlength='255' value=\"".escape($fax_email)."\">\n";
echo "<br />\n";
echo " ".$text['description-email']."\n";
echo "</td>\n";
@ -499,7 +499,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-name']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_name' maxlength='255' value=\"$fax_name\" required='required'>\n";
echo " <input class='formfld' type='text' name='fax_name' maxlength='255' value=\"".escape($fax_name)."\" required='required'>\n";
echo "<br />\n";
echo "".$text['description-name']."\n";
echo "</td>\n";
@ -510,7 +510,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-extension']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_extension' maxlength='255' value=\"$fax_extension\" required='required'>\n";
echo " <input class='formfld' type='text' name='fax_extension' maxlength='255' value=\"".escape($fax_extension)."\" required='required'>\n";
echo "<br />\n";
echo "".$text['description-extension']."\n";
echo "</td>\n";
@ -522,7 +522,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
if ($action == "add") { $fax_accountcode = $_SESSION['domain_name']; }
echo " <input class='formfld' type='text' name='accountcode' maxlength='255' value=\"".$fax_accountcode."\">\n";
echo " <input class='formfld' type='text' name='accountcode' maxlength='255' value=\"".escape($fax_accountcode)."\">\n";
echo "<br />\n";
echo $text['description-accountcode']."\n";
echo "</td>\n";
@ -533,7 +533,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-destination-number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_destination_number' maxlength='255' value=\"$fax_destination_number\">\n";
echo " <input class='formfld' type='text' name='fax_destination_number' maxlength='255' value=\"".escape($fax_destination_number)."\">\n";
echo "<br />\n";
echo " ".$text['description-destination-number']."\n";
echo "</td>\n";
@ -544,7 +544,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-fax_prefix']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_prefix' maxlength='255' value=\"$fax_prefix\">\n";
echo " <input class='formfld' type='text' name='fax_prefix' maxlength='255' value=\"".escape($fax_prefix)."\">\n";
echo "<br />\n";
echo " ".$text['description-fax_prefix']."\n";
echo "</td>\n";
@ -561,7 +561,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
foreach($fax_emails as $email) {
echo "<tr>\n";
echo "<td>\n";
echo " <input class='formfld' type=\"text\" name=\"fax_email[".$x."]\" maxlength='255' style=\"width: 90%;\"value=\"".$email."\">\n";
echo " <input class='formfld' type=\"text\" name=\"fax_email[".$x."]\" maxlength='255' style=\"width: 90%;\"value=\"".escape($email)."\">\n";
echo "</td>\n";
$x++;
}
@ -584,7 +584,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-caller-id-name']."\n";
echo "</td>\n";
echo "<td width='70%' class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_caller_id_name' maxlength='255' value=\"$fax_caller_id_name\">\n";
echo " <input class='formfld' type='text' name='fax_caller_id_name' maxlength='255' value=\"".escape($fax_caller_id_name)."\">\n";
echo "<br />\n";
echo "".$text['description-caller-id-name']."\n";
echo "</td>\n";
@ -595,7 +595,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-caller-id-number']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_caller_id_number' maxlength='255' min='0' step='1' value=\"$fax_caller_id_number\">\n";
echo " <input class='formfld' type='text' name='fax_caller_id_number' maxlength='255' min='0' step='1' value=\"".escape($fax_caller_id_number)."\">\n";
echo "<br />\n";
echo "".$text['description-caller-id-number']."\n";
echo "</td>\n";
@ -606,7 +606,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-forward']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_forward_number' maxlength='255' value=\"".((is_numeric($fax_forward_number)) ? format_phone($fax_forward_number) : $fax_forward_number)."\">\n";
echo " <input class='formfld' type='text' name='fax_forward_number' maxlength='255' value=\"".((is_numeric($fax_forward_number)) ? format_phone($fax_forward_number) : escape($fax_forward_number))."\">\n";
echo "<br />\n";
echo "".$text['description-forward-number']."\n";
echo "</td>\n";
@ -630,9 +630,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <table width='52%'>\n";
foreach($result as $field) {
echo " <tr>\n";
echo " <td class='vtable'>".$field['username']."</td>\n";
echo " <td class='vtable'>".escape($field['username'])."</td>\n";
echo " <td>\n";
echo " <a href='fax_edit.php?id=".$fax_uuid."&domain_uuid=".$_SESSION['domain_uuid']."&user_uuid=".$field['user_uuid']."&a=delete' alt='delete' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " <a href='fax_edit.php?id=".escape($fax_uuid)."&domain_uuid=".$_SESSION['domain_uuid']."&user_uuid=".$field['user_uuid']."&a=delete' alt='delete' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo " </tr>\n";
$assigned_user_uuids[] = $field['user_uuid'];
@ -652,7 +652,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <option value=\"\"></option>\n";
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach($result as $field) {
echo " <option value='".$field['user_uuid']."'>".$field['username']."</option>\n";
echo " <option value='".escape($field['user_uuid'])."'>".escape($field['username'])."</option>\n";
}
echo " </select>";
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
@ -712,7 +712,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($file != "." && $file != ".." && $file[0] != '.') {
if (!is_dir($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file)) {
$selected = ($fax_send_greeting == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file && strlen($fax_send_greeting) > 0) ? true : false;
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file."' ".(($selected) ? "selected='selected'" : null).">".$file."</option>\n";
echo " <option value='".escape($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$file)."' ".(($selected) ? "selected='selected'" : null).">".escape($file)."</option>\n";
if ($selected) { $tmp_selected = true; }
}
}
@ -729,7 +729,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<optgroup label='Phrases'>\n";
foreach ($result as &$row) {
$selected = ($fax_send_greeting == "phrase:".$row["phrase_uuid"]) ? true : false;
echo " <option value='phrase:".$row["phrase_uuid"]."' ".(($selected) ? "selected='selected'" : null).">".$row["phrase_name"]."</option>\n";
echo " <option value='phrase:".escape($row["phrase_uuid"])."' ".(($selected) ? "selected='selected'" : null).">".escape($row["phrase_name"])."</option>\n";
if ($selected) { $tmp_selected = true; }
}
unset ($prep_statement);
@ -746,7 +746,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$fax_send_greeting = substr($fax_send_greeting, 71);
}
$selected = ($fax_send_greeting == $value) ? true : false;
echo " <option value='".$value."' ".(($selected) ? "selected='selected'" : null).">".$value."</option>\n";
echo " <option value='".escape($value)."' ".(($selected) ? "selected='selected'" : null).">".escape($value)."</option>\n";
if ($selected) { $tmp_selected = true; }
}
}
@ -758,13 +758,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if (!$tmp_selected) {
echo "<optgroup label='selected'>\n";
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$fax_send_greeting)) {
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$fax_send_greeting."' selected='selected'>".$ivr_menu_greet_long."</option>\n";
echo " <option value='".escape($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$fax_send_greeting)."' selected='selected'>".escape($ivr_menu_greet_long)."</option>\n";
}
else if (substr($fax_send_greeting, -3) == "wav" || substr($fax_send_greeting, -3) == "mp3") {
echo " <option value='".$fax_send_greeting."' selected='selected'>".$fax_send_greeting."</option>\n";
echo " <option value='".escape($fax_send_greeting)."' selected='selected'>".escape($fax_send_greeting)."</option>\n";
}
else {
echo " <option value='".$fax_send_greeting."' selected='selected'>".$fax_send_greeting."</option>\n";
echo " <option value='".escape($fax_send_greeting)."' selected='selected'>".escape($fax_send_greeting)."</option>\n";
}
echo "</optgroup>\n";
}
@ -782,7 +782,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-fax_send_channels']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_send_channels' maxlength='255' value=\"$fax_send_channels\">\n";
echo " <input class='formfld' type='text' name='fax_send_channels' maxlength='255' value=\"".escape($fax_send_channels)."\">\n";
echo "<br />\n";
echo " ".$text['description-fax_send_channels']."\n";
echo "</td>\n";
@ -793,7 +793,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " ".$text['label-description']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='fax_description' maxlength='255' value=\"$fax_description\">\n";
echo " <input class='formfld' type='text' name='fax_description' maxlength='255' value=\"".escape($fax_description)."\">\n";
echo "<br />\n";
echo "".$text['description-info']."\n";
echo "</td>\n";
@ -805,16 +805,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <br>";
if ($action == "update") {
if (!permission_exists('fax_extension_delete')) {
echo " <input type='hidden' name='fax_name' value=\"$fax_name\">\n";
echo " <input type='hidden' name='fax_extension' value=\"$fax_extension\">\n";
echo " <input type='hidden' name='fax_destination_number' value=\"$fax_destination_number\">\n";
echo " <input type='hidden' name='fax_caller_id_name' value=\"$fax_caller_id_name\">\n";
echo " <input type='hidden' name='fax_caller_id_number' value=\"$fax_caller_id_number\">\n";
echo " <input type='hidden' name='fax_forward_number' value=\"".((is_numeric($fax_forward_number)) ? format_phone($fax_forward_number) : $fax_forward_number)."\">\n";
echo " <input type='hidden' name='fax_description' value=\"$fax_description\">\n";
echo " <input type='hidden' name='fax_name' value=\"".escape($fax_name)."\">\n";
echo " <input type='hidden' name='fax_extension' value=\"".escape($fax_extension)."\">\n";
echo " <input type='hidden' name='fax_destination_number' value=\"".escape($fax_destination_number)."\">\n";
echo " <input type='hidden' name='fax_caller_id_name' value=\"".escape($fax_caller_id_name)."\">\n";
echo " <input type='hidden' name='fax_caller_id_number' value=\"".escape($fax_caller_id_number)."\">\n";
echo " <input type='hidden' name='fax_forward_number' value=\"".((is_numeric($fax_forward_number)) ? format_phone($fax_forward_number) : escape($fax_forward_number))."\">\n";
echo " <input type='hidden' name='fax_description' value=\"".escape($fax_description)."\">\n";
}
echo " <input type='hidden' name='fax_uuid' value='$fax_uuid'>\n";
echo " <input type='hidden' name='dialplan_uuid' value='$dialplan_uuid'>\n";
echo " <input type='hidden' name='fax_uuid' value='".escape($fax_uuid)."'>\n";
echo " <input type='hidden' name='dialplan_uuid' value='".escape($dialplan_uuid)."'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";