* Portions created by the Initial Developer are Copyright (C) 2008-2025 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Mark J Crane * Tim Fry */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (!permission_exists('conference_interactive_view')) { echo "access denied"; exit; } //show intended global variables global $domain_uuid, $user_uuid, $settings, $database, $config; //get the domain uuid if (empty($domain_uuid)) { $domain_uuid = $_SESSION['domain_uuid'] ?? ''; } //get the user uuid if (empty($user_uuid)) { $user_uuid = $_SESSION['user_uuid'] ?? ''; } //load the config if (!($config instanceof config)) { $config = config::load(); } //load the database if (!($database instanceof database)) { $database = new database; } //load the settings if (!($settings instanceof settings)) { $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); } //add multi-lingual support $language = new text; $text = $language->get(); //get the http get or post and set it as php variables if (!empty($_REQUEST["c"]) && is_numeric($_REQUEST["c"])) { $conference_id = $_REQUEST["c"]; } elseif (!empty($_REQUEST["c"]) && is_uuid($_REQUEST["c"])) { $conference_id = $_REQUEST["c"]; } else { //exit if the conference id is invalid exit; } //replace the space with underscore $conference_name = $conference_id.'@'.$_SESSION['domain_name']; //get and prepare the conference display name $conference_display_name = str_replace("-", " ", $conference_id); $conference_display_name = str_replace("_", " ", $conference_display_name); //create token $token = (new token())->create($_SERVER['PHP_SELF']); // Pass the token to the subscriber class so that when this subscriber makes a websocket // connection, the subscriber object can validate the information. subscriber::save_token($token, ['active.conferences']); //show the header $document['title'] = $text['label-interactive']; require_once dirname(__DIR__, 2) . "/resources/header.php"; //break the caching $version = md5(file_get_contents(__DIR__ . '/resources/javascript/websocket_client.js')); //build permissions object for client-side checks $user_permissions = [ 'lock' => permission_exists('conference_interactive_lock'), 'mute' => permission_exists('conference_interactive_mute'), 'deaf' => permission_exists('conference_interactive_deaf'), 'kick' => permission_exists('conference_interactive_kick'), 'energy' => permission_exists('conference_interactive_energy'), 'volume' => permission_exists('conference_interactive_volume'), 'gain' => permission_exists('conference_interactive_gain'), 'video' => permission_exists('conference_interactive_video'), ]; //get websocket settings from default settings $ws_settings = [ 'reconnect_delay' => (int)$settings->get('active_conferences', 'reconnect_delay', 2000), 'ping_interval' => (int)$settings->get('active_conferences', 'ping_interval', 30000), 'auth_timeout' => (int)$settings->get('active_conferences', 'auth_timeout', 10000), 'pong_timeout' => (int)$settings->get('active_conferences', 'pong_timeout', 10000), 'refresh_interval' => (int)$settings->get('active_conferences', 'refresh_interval', 0), 'max_reconnect_delay' => (int)$settings->get('active_conferences', 'max_reconnect_delay', 30000), 'pong_timeout_max_retries' => (int)$settings->get('active_conferences', 'pong_timeout_max_retries', 3), ]; //get theme colors for status indicator $status_colors = [ 'connected' => $settings->get('theme', 'active_conference_status_connected', '#28a745'), 'warning' => $settings->get('theme', 'active_conference_status_warning', '#ffc107'), 'disconnected' => $settings->get('theme', 'active_conference_status_disconnected', '#dc3545'), 'connecting' => $settings->get('theme', 'active_conference_status_connecting', '#6c757d'), ]; //get status indicator mode and icons $status_indicator_mode = $settings->get('theme', 'active_conference_status_indicator_mode', 'color'); $status_icons = [ 'connected' => $settings->get('theme', 'active_conference_status_icon_connected', 'fa-solid fa-plug-circle-check'), 'warning' => $settings->get('theme', 'active_conference_status_icon_warning', 'fa-solid fa-plug-circle-exclamation'), 'disconnected' => $settings->get('theme', 'active_conference_status_icon_disconnected', 'fa-solid fa-plug-circle-xmark'), 'connecting' => $settings->get('theme', 'active_conference_status_icon_connecting', 'fa-solid fa-plug fa-fade'), ]; //get status tooltips from translations $status_tooltips = [ 'connected' => $text['status-connected'], 'warning' => $text['status-warning'], 'disconnected' => $text['status-disconnected'], 'connecting' => $text['status-connecting'], ]; ?> \n"; echo "
".$text['label-interactive']." "; if ($status_indicator_mode === 'icon') { echo ""; } else { echo "
"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo $text['description-interactive']."\n"; echo "

\n"; //show the content echo "
\n"; echo "

\n"; ?>