TalkGroup * ` against the NXDNGateway remote-control port * configured in /etc/nxdngateway. Triggers a 2 s `setTimeout` reload. * * Inputs: * /etc/nxdngateway Gateway config + remote port. * /usr/local/etc/NXDNHosts.txt Operator picklist. * /usr/local/etc/NXDNHostsLocal.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 NXDN is Enabled $testMMDVModeNXDN = getConfigItem("NXDN Network", "Enable", $mmdvmconfigs); if ( $testMMDVModeNXDN == 1 ) { //Load the nxdngateway config file $nxdnGatewayConfigFile = '/etc/nxdngateway'; if (fopen($nxdnGatewayConfigFile,'r')) { $confignxdngateway = parse_ini_file($nxdnGatewayConfigFile, true); } // Check that the remote is enabled if ( $confignxdngateway['Remote Commands']['Enable'] == 1 ) { $remotePort = $confignxdngateway['Remote Commands']['Port']; if (!empty($_POST) && isset($_POST["nxdnMgrSubmit"])) { // Handle Posted Data if (preg_match('/[^A-Za-z0-9]/',$_POST['nxdnLinkHost'])) { unset ($_POST['nxdnLinkHost']);} if ($_POST["Link"] == "LINK") { if ($_POST['nxdnLinkHost'] == "none") { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup unlink"; } else { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup ".$_POST['nxdnLinkHost']; } } elseif ($_POST["Link"] == "UNLINK") { $remoteCommand = "cd /var/log/pi-star && sudo /usr/local/bin/RemoteCommand ".$remotePort." TalkGroup unlink"; } else { echo "NXDN 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['nxdnLinkHost'])) { echo "NXDN 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 "NXDN 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 ?> NXDN Link Manager
ReflectorReflector Link / Un-LinkLink / Un-Link ActionAction
Link UnLink