main
This commit is contained in:
+6
-36
@@ -1,33 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* POCSAG / DAPNET pager-message partial.
|
||||
*
|
||||
* AJAX-loaded partial; refreshed every 5 seconds by /index.php — only
|
||||
* when the POCSAG Network is enabled in /etc/mmdvmhost. Renders a
|
||||
* small table of recent paging messages with optional Skyper decoding
|
||||
* (the German weather-alert service that uses ROT-1 obfuscation, RIC
|
||||
* pre-amble bytes, and rubric / message-number indexing).
|
||||
*
|
||||
* Skyper decode logic (in this file) translates Skyper RICs into a
|
||||
* "[Skyper Rubric:N Msg:M] <decoded text>" preview where applicable.
|
||||
*
|
||||
* Data flow: parses the in-memory `$logLinesDAPNETGateway` array
|
||||
* populated by mmdvmhost/functions.php from
|
||||
* /var/log/pi-star/DAPNETGateway-YYYY-MM-DD.log.
|
||||
*
|
||||
* Most of the work here contributed by geeks4hire (Ben Horan); Skyper
|
||||
* decode added by Andy Taylor (MW0MWZ).
|
||||
*/
|
||||
|
||||
|
||||
// AJAX-loaded partial — embeddable variant only. The earlier
|
||||
// duplicate setSecurityHeaders() call has been removed; that
|
||||
// non-embeddable variant raced with this one and won via the
|
||||
// headers_sent() guard, so the file was effectively shipping
|
||||
// X-Frame-Options / frame-ancestors despite the embeddable
|
||||
// version being added below it.
|
||||
require_once($_SERVER['DOCUMENT_ROOT'] . '/config/security_headers.php');
|
||||
setEmbeddableSecurityHeaders();
|
||||
// Most of the work here contributed by geeks4hire (Ben Horan)
|
||||
// Skyper decode by Andy Taylor (MW0MWZ)
|
||||
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/config.php'; // MMDVMDash Config
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/tools.php'; // MMDVMDash Tools
|
||||
@@ -35,8 +8,7 @@ include_once $_SERVER['DOCUMENT_ROOT'].'/mmdvmhost/functions.php'; // MMDVMDa
|
||||
include_once $_SERVER['DOCUMENT_ROOT'].'/config/language.php'; // Translation Code
|
||||
|
||||
// Function to reverse the ROT1 used for Skyper
|
||||
function un_rot($message)
|
||||
{
|
||||
function un_rot($message) {
|
||||
$output = "";
|
||||
$messageTextArray = str_split($message);
|
||||
|
||||
@@ -53,8 +25,7 @@ function un_rot($message)
|
||||
}
|
||||
|
||||
// Function to handle Skyper Messages
|
||||
function skyper($message, $pocsagric)
|
||||
{
|
||||
function skyper($message, $pocsagric) {
|
||||
$output = "";
|
||||
$messageTextArray = str_split($message);
|
||||
|
||||
@@ -93,7 +64,7 @@ function skyper($message, $pocsagric)
|
||||
$skyperMsgNr = ord($messageTextArray[1]) - 32;
|
||||
unset($messageTextArray[1]);
|
||||
}
|
||||
|
||||
|
||||
if (count($messageTextArray) >= 1) { // Check to see if there is a message to decode
|
||||
$output = "[Skyper Rubric:$skyperRubric Msg:$skyperMsgNr] ".un_rot(implode($messageTextArray));
|
||||
}
|
||||
@@ -149,7 +120,7 @@ function skyper($message, $pocsagric)
|
||||
if (isset($pocsag_timeslot)) { $pocsag_timeslot = htmlspecialchars($pocsag_timeslot, ENT_QUOTES, 'UTF-8'); }
|
||||
if (isset($pocsag_ric)) { $pocsag_ric = htmlspecialchars($pocsag_ric, ENT_QUOTES, 'UTF-8'); }
|
||||
if (isset($pocsag_msg)) { $pocsag_msg = htmlspecialchars($pocsag_msg, ENT_QUOTES, 'UTF-8'); }
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
@@ -164,4 +135,3 @@ function skyper($message, $pocsagric)
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user