TalkGroup * ` against the P25Gateway remote-control port configured * in /etc/p25gateway. Triggers a 2 s `setTimeout` reload. * * Inputs: * /etc/p25gateway Gateway config + remote port. * /usr/local/etc/P25Hosts.txt Operator picklist. * /usr/local/etc/P25HostsLocal.txt Local additions (optional). * * NOTE for the security pass: validation is whitelist-regex; no * setEmbeddableSecurityHeaders() call in this file. Coverage gap. */ if ($_SERVER["PHP_SELF"] == "/admin/index.php") { // Stop this working outside of the admin page include_once $_SERVER['DOCUMENT_ROOT'].'/config/config.php'; // MMDVMDash Config include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/tools.php'; // MMDVMDash Tools include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/functions.php'; // MMDVMDash Functions include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code // Check if P25 is Enabled $testMMDVModeP25 = getConfigItem("P25 Network", "Enable", $mmdvmconfigs); if ( $testMMDVModeP25 == 1 ) { //Load the p25gateway config file $p25GatewayConfigFile = '/etc/p25gateway'; if (fopen($p25GatewayConfigFile,'r')) { $configp25gateway = parse_ini_file($p25GatewayConfigFile, true); } // Check that the remote is enabled if ( $configp25gateway['Remote Commands']['Enable'] == 1 ) { $remotePort = $configp25gateway['Remote Commands']['Port']; if (!empty($_POST) && isset($_POST["p25MgrSubmit"])) { // Handle Posted Data if (preg_match('/[^A-Za-z0-9]/',$_POST['p25LinkHost'])) { unset ($_POST['p25LinkHost']);} if ($_POST["Link"] == "LINK") { if ($_POST['p25LinkHost'] == "none") { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup 9999"; } else { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup ".$_POST['p25LinkHost']; } } elseif ($_POST["Link"] == "UNLINK") { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup 9999"; } else { echo "P25 Link Manager\n"; echo "\n\n\n
Command Output
"; echo "Somthing wrong with your input, (Neither Link nor Unlink Sent) - please try again"; echo "
\n
\n"; unset($_POST); echo ''; } if (empty($_POST['p25LinkHost'])) { echo "P25 Link Manager\n"; echo "\n\n\n
Command Output
"; echo "Somthing wrong with your input, (No target specified) - please try again"; echo "
\n
\n"; unset($_POST); echo ''; } if (isset($remoteCommand)) { echo "P25 Link Manager\n"; echo "\n\n\n
Command Output
"; echo htmlspecialchars((string)exec($remoteCommand), ENT_QUOTES, 'UTF-8'); echo "
\n
\n"; echo ''; } } else { // Output HTML ?> P25 Link Manager
ReflectorReflector Link / Un-LinkLink / Un-Link ActionAction
Link UnLink