voicemail edit, log viewer, and sip status php 8.1 changes (#6738)
* Update voicemail_edit.php * Update sip_status.php * Update message.php * Update log_viewer.php * Update log_viewer.php * Update sip_status.php
This commit is contained in:
@@ -200,7 +200,10 @@
|
|||||||
$array_filter[6]['type'] = 'bold';
|
$array_filter[6]['type'] = 'bold';
|
||||||
$array_filter[6]['font'] = 'monospace';
|
$array_filter[6]['font'] = 'monospace';
|
||||||
|
|
||||||
|
$file_size = 0;
|
||||||
|
if (file_exists($log_file)) {
|
||||||
$file_size = filesize($log_file);
|
$file_size = filesize($log_file);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// removed: duplicate of above
|
// removed: duplicate of above
|
||||||
@@ -248,7 +251,7 @@
|
|||||||
else {
|
else {
|
||||||
//open the file
|
//open the file
|
||||||
$byte_count ='0';
|
$byte_count ='0';
|
||||||
if ($file) {
|
if (!empty($file)) {
|
||||||
fseek($file, 0);
|
fseek($file, 0);
|
||||||
}
|
}
|
||||||
echo "<br>".$text['label-open_file']."<br>";
|
echo "<br>".$text['label-open_file']."<br>";
|
||||||
@@ -272,7 +275,7 @@
|
|||||||
|
|
||||||
//start processing
|
//start processing
|
||||||
$byte_count = 0;
|
$byte_count = 0;
|
||||||
if ($file) {
|
if (!empty($file)) {
|
||||||
while(!feof($file)) {
|
while(!feof($file)) {
|
||||||
$log_line = escape(fgets($file));
|
$log_line = escape(fgets($file));
|
||||||
$byte_count++;
|
$byte_count++;
|
||||||
@@ -342,7 +345,7 @@
|
|||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
//close the file
|
//close the file
|
||||||
if ($file) {
|
if (!empty($file)) {
|
||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
$sql = "select sip_profile_uuid, sip_profile_name from v_sip_profiles ";
|
$sql = "select sip_profile_uuid, sip_profile_name from v_sip_profiles ";
|
||||||
$sql .= "where sip_profile_enabled = 'true' ";
|
$sql .= "where sip_profile_enabled = 'true' ";
|
||||||
if ($hostname) {
|
if (!empty($hostname)) {
|
||||||
$sql .= "and (sip_profile_hostname = :sip_profile_hostname ";
|
$sql .= "and (sip_profile_hostname = :sip_profile_hostname ";
|
||||||
$sql .= "or sip_profile_hostname = '' ";
|
$sql .= "or sip_profile_hostname = '' ";
|
||||||
$sql .= "or sip_profile_hostname is null) ";
|
$sql .= "or sip_profile_hostname is null) ";
|
||||||
@@ -75,8 +75,8 @@
|
|||||||
}
|
}
|
||||||
$sql .= "order by sip_profile_name asc ";
|
$sql .= "order by sip_profile_name asc ";
|
||||||
$database = new database;
|
$database = new database;
|
||||||
$rows = $database->select($sql, $parameters, 'all');
|
$rows = $database->select($sql, $parameters ?? null, 'all');
|
||||||
if (is_array($rows) && @sizeof($rows) != 0) {
|
if (!empty($rows)) {
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$sip_profiles[$row['sip_profile_name']] = $row['sip_profile_uuid'];
|
$sip_profiles[$row['sip_profile_name']] = $row['sip_profile_uuid'];
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
//profiles
|
//profiles
|
||||||
if ($xml->profile) {
|
if (!empty($xml) && $xml->profile) {
|
||||||
foreach ($xml->profile as $row) {
|
foreach ($xml->profile as $row) {
|
||||||
unset($list_row_url);
|
unset($list_row_url);
|
||||||
$profile_name = (string) $row->name;
|
$profile_name = (string) $row->name;
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//gateways
|
//gateways
|
||||||
if ($xml_gateways->gateway) {
|
if (!empty($xml_gateways) && $xml_gateways->gateway) {
|
||||||
foreach ($xml_gateways->gateway as $row) {
|
foreach ($xml_gateways->gateway as $row) {
|
||||||
unset($gateway_name, $gateway_domain_name, $list_row_url);
|
unset($gateway_name, $gateway_domain_name, $list_row_url);
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//aliases
|
//aliases
|
||||||
if ($xml->alias) {
|
if (!empty($xml) && $xml->alias) {
|
||||||
foreach ($xml->alias as $row) {
|
foreach ($xml->alias as $row) {
|
||||||
echo "<tr class='list-row'>\n";
|
echo "<tr class='list-row'>\n";
|
||||||
echo " <td>".escape($row->name)."</td>\n";
|
echo " <td>".escape($row->name)."</td>\n";
|
||||||
|
|||||||
@@ -66,11 +66,12 @@
|
|||||||
$show_option_delete = '';
|
$show_option_delete = '';
|
||||||
$voicemail_option_digits = '';
|
$voicemail_option_digits = '';
|
||||||
$voicemail_option_description = '';
|
$voicemail_option_description = '';
|
||||||
|
$voicemail_mail_to = '';
|
||||||
|
|
||||||
//get http variables and set them to php variables
|
//get http variables and set them to php variables
|
||||||
$referer_path = $_REQUEST["referer_path"] ?? '';
|
$referer_path = $_REQUEST["referer_path"] ?? '';
|
||||||
$referer_query = $_REQUEST["referer_query"] ?? '';
|
$referer_query = $_REQUEST["referer_query"] ?? '';
|
||||||
if (count($_POST) > 0) {
|
if (!empty($_POST)) {
|
||||||
|
|
||||||
//process the http post data by submitted action
|
//process the http post data by submitted action
|
||||||
if ($_POST['action'] != '' && is_uuid($_POST['voicemail_uuid'])) {
|
if ($_POST['action'] != '' && is_uuid($_POST['voicemail_uuid'])) {
|
||||||
@@ -113,7 +114,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//process the data
|
//process the data
|
||||||
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if ($action == "update") {
|
if ($action == "update") {
|
||||||
@@ -146,7 +147,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//add or update the database
|
//add or update the database
|
||||||
if ($_POST["persistformvar"] != "true") {
|
if (empty($_POST["persistformvar"])) {
|
||||||
|
|
||||||
//get a new voicemail_uuid
|
//get a new voicemail_uuid
|
||||||
if ($action == "add" && permission_exists('voicemail_add')) {
|
if ($action == "add" && permission_exists('voicemail_add')) {
|
||||||
@@ -361,7 +362,7 @@
|
|||||||
unset($sql, $parameters);
|
unset($sql, $parameters);
|
||||||
|
|
||||||
$show_option_delete = false;
|
$show_option_delete = false;
|
||||||
if (is_array($voicemail_options) && @sizeof($voicemail_options) != 0) {
|
if (!empty($voicemail_options)) {
|
||||||
foreach ($voicemail_options as $x => $field) {
|
foreach ($voicemail_options as $x => $field) {
|
||||||
$voicemail_option_param = $field['voicemail_option_param'];
|
$voicemail_option_param = $field['voicemail_option_param'];
|
||||||
if (empty(trim($voicemail_option_param))) {
|
if (empty(trim($voicemail_option_param))) {
|
||||||
@@ -416,7 +417,7 @@
|
|||||||
}
|
}
|
||||||
$sql .= "order by v.voicemail_id asc";
|
$sql .= "order by v.voicemail_id asc";
|
||||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||||
if (is_uuid($voicemail_uuid ?? '')) {
|
if (!empty($voicemail_uuid) && is_uuid($voicemail_uuid)) {
|
||||||
$parameters['voicemail_uuid'] = $voicemail_uuid;
|
$parameters['voicemail_uuid'] = $voicemail_uuid;
|
||||||
}
|
}
|
||||||
$database = new database;
|
$database = new database;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ if (!class_exists('message')) {
|
|||||||
$mood = $mood ?: 'positive';
|
$mood = $mood ?: 'positive';
|
||||||
$delay = $delay ?: (1000 * (float) $_SESSION['theme']['message_delay']['text']);
|
$delay = $delay ?: (1000 * (float) $_SESSION['theme']['message_delay']['text']);
|
||||||
//ignore duplicate messages
|
//ignore duplicate messages
|
||||||
if (isset($_SESSION["messages"]) && is_array($_SESSION["messages"][$mood]['message']) && @sizeof($_SESSION["messages"][$mood]['message']) != 0) {
|
if (isset($_SESSION["messages"]) && !empty($_SESSION["messages"][$mood]['message'])) {
|
||||||
if (!in_array($message, $_SESSION["messages"][$mood]['message'])) {
|
if (!in_array($message, $_SESSION["messages"][$mood]['message'])) {
|
||||||
$_SESSION["messages"][$mood]['message'][] = $message;
|
$_SESSION["messages"][$mood]['message'][] = $message;
|
||||||
$_SESSION["messages"][$mood]['delay'][] = $delay;
|
$_SESSION["messages"][$mood]['delay'][] = $delay;
|
||||||
|
|||||||
Reference in New Issue
Block a user