Active Conferences: Updates for PHP 8.1

This commit is contained in:
fusionate 2023-05-25 21:08:30 +00:00
parent fd0118206d
commit 035ba1b86b
No known key found for this signature in database
3 changed files with 22 additions and 20 deletions

View File

@ -27,7 +27,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2022 Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -57,10 +57,10 @@
if (count($_GET) > 0) { if (count($_GET) > 0) {
$cmd = trim($_GET["cmd"]); $cmd = trim($_GET["cmd"]);
$name = trim($_GET["name"]); $name = trim($_GET["name"]);
$uuid = trim($_GET["uuid"]); $uuid = trim($_GET["uuid"] ?? '');
$data = trim($_GET["data"]); $data = trim($_GET["data"]);
$id = trim($_GET["id"]); $id = trim($_GET["id"] ?? '');
$direction = trim($_GET["direction"]); $direction = trim($_GET["direction"] ?? '');
} }
//authorized commands //authorized commands

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019 Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -117,17 +117,19 @@
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d"); $recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
$recording_name = ''; $recording_name = '';
if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) { if (!empty($recording_dir) && !empty($row['uuid'])) {
$recording_name = $session_uuid.".wav"; if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) {
} $recording_name = $session_uuid.".wav";
elseif (file_exists($recording_dir.'/'.$row['uuid'].'.mp3')) { }
$recording_name = $session_uuid.".mp3"; else if (file_exists($recording_dir.'/'.$row['uuid'].'.mp3')) {
$recording_name = $session_uuid.".mp3";
}
} }
echo "<img src='resources/images/".(($recording == "true") ? "recording.png" : "not_recording.png")."' style='width: 16px; height: 16px; border: none;' align='absmiddle' title=\"".$text['label-'.(($recording == "true") ? 'recording' : 'not-recording')]."\">&nbsp;&nbsp;"; echo "<img src='resources/images/".(!empty($recording) && $recording == "true" ? "recording.png" : "not_recording.png")."' style='width: 16px; height: 16px; border: none;' align='absmiddle' title=\"".$text['label-'.(!empty($recording) && $recording == "true" ? 'recording' : 'not-recording')]."\">&nbsp;&nbsp;";
if (permission_exists('conference_interactive_lock')) { if (permission_exists('conference_interactive_lock')) {
if ($locked == 'true') { if (!empty($locked) && $locked == 'true') {
echo button::create(['type'=>'button','label'=>$text['label-unlock'],'icon'=>'unlock','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=unlock');"]); echo button::create(['type'=>'button','label'=>$text['label-unlock'],'icon'=>'unlock','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=unlock');"]);
} }
else { else {
@ -135,7 +137,7 @@
} }
} }
if (permission_exists('conference_interactive_mute')) { if (permission_exists('conference_interactive_mute')) {
if ($mute_all == 'true') { if (!empty($mute_all) && $mute_all == 'true') {
echo button::create(['type'=>'button','label'=>$text['label-unmute-all'],'icon'=>'microphone','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=unmute+non_moderator');"]); echo button::create(['type'=>'button','label'=>$text['label-unmute-all'],'icon'=>'microphone','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=unmute+non_moderator');"]);
} }
else { else {
@ -145,7 +147,7 @@
echo button::create(['type'=>'button','label'=>$text['label-end-conference'],'icon'=>'stop','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=kick+all');"]); echo button::create(['type'=>'button','label'=>$text['label-end-conference'],'icon'=>'stop','collapse'=>'hide-xs','onclick'=>"send_cmd('conference_exec.php?cmd=conference&name=".urlencode($conference_name)."&data=kick+all');"]);
echo "</div>\n"; echo "</div>\n";
echo "<strong>".$text['label-members'].": ".escape($member_count)."</strong>\n"; echo "<strong>".$text['label-members'].": ".escape($member_count ?? '')."</strong>\n";
echo "<br /><br />\n"; echo "<br /><br />\n";
echo "<table class='list'>\n"; echo "<table class='list'>\n";
@ -188,8 +190,8 @@
$switch_cmd = "uuid_getvar ".$uuid. " hand_raised"; $switch_cmd = "uuid_getvar ".$uuid. " hand_raised";
$hand_raised = (trim(event_socket_request($fp, 'api '.$switch_cmd)) == "true") ? "true" : "false"; $hand_raised = (trim(event_socket_request($fp, 'api '.$switch_cmd)) == "true") ? "true" : "false";
//format seconds //format seconds
$join_time_formatted = sprintf('%02d:%02d:%02d', ($join_time/3600), ($join_time/60%60), $join_time%60); $join_time_formatted = sprintf('%02d:%02d:%02d', floor($join_time / 3600), floor($join_time / 60), $join_time % 60);
$last_talking_formatted = sprintf('%02d:%02d:%02d', ($last_talking/3600), ($last_talking/60%60), $last_talking%60); $last_talking_formatted = sprintf('%02d:%02d:%02d', floor($last_talking / 3600), floor($last_talking / 60), $last_talking % 60);
if (empty($record_path)) { if (empty($record_path)) {
if (permission_exists('conference_interactive_mute')) { if (permission_exists('conference_interactive_mute')) {
@ -274,4 +276,4 @@
echo "<br /><br />"; echo "<br /><br />";
} }
?> ?>

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019 Portions created by the Initial Developer are Copyright (C) 2008-2023
the Initial Developer. All Rights Reserved. the Initial Developer. All Rights Reserved.
Contributor(s): Contributor(s):
@ -147,7 +147,7 @@
echo " <td>".escape($conference_extension)."</td>\n"; echo " <td>".escape($conference_extension)."</td>\n";
echo " <td>".escape($participant_pin)."</td>\n"; echo " <td>".escape($participant_pin)."</td>\n";
echo " <td class='center'>".escape($member_count)."</td>\n"; echo " <td class='center'>".escape($member_count)."</td>\n";
if (permission_exists('conference_interactive_view') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') { if (permission_exists('conference_interactive_view') && !empty($_SESSION['theme']['list_row_edit_button']['boolean']) && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
echo " <td class='action-button'>"; echo " <td class='action-button'>";
echo button::create(['type'=>'button','title'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]); echo button::create(['type'=>'button','title'=>$text['button-view'],'icon'=>$_SESSION['theme']['button_icon_view'],'link'=>$list_row_url]);
echo " </td>\n"; echo " </td>\n";
@ -160,4 +160,4 @@
echo "<br /><br />"; echo "<br /><br />";
} }
?> ?>