This commit is contained in:
2026-07-19 18:27:27 +08:00
parent fe4b286ce1
commit 0febcf69f4
170 changed files with 19490 additions and 11878 deletions
+24 -43
View File
@@ -1,24 +1,4 @@
<?php
/**
* CCS (Connected Community System) connections + StarNet groups partial.
*
* AJAX-loaded partial; refreshed every 15 seconds by /index.php. Two
* sections rendered conditionally:
* 1. Active CCS Connections — read from /var/log/pi-star/Links.log,
* surfaced only if the log contains at least one "CCS link" line.
* 2. StarNet groups — included via active_starnet_groups.php only when
* `starNetCallsign1`..`5` are configured in /etc/ircddbgateway.
*
* AJAX-loaded partial — embeddable variant only. Omits the
* X-Frame-Options / frame-ancestors directives the parent already
* asserts; they apply to iframe ancestry, not XHR responses.
*/
require_once($_SERVER['DOCUMENT_ROOT'] . '/config/security_headers.php');
setEmbeddableSecurityHeaders();
include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/config/ircddblocal.php';
$configs = array();
if ($configfile = fopen($gatewayConfigPath,'r')) {
@@ -50,33 +30,33 @@ if (exec('grep "CCS link" '.$linkLogPath.' | wc -l') >=1) {
$ci = 0;
if ($linkLog = fopen($linkLogPath,'r')) {
$i=0;
while ($linkLine = fgets($linkLog)) {
$i=0;
while ($linkLine = fgets($linkLog)) {
// 2013-02-27 19:49:27: CCS link - Rptr: DB0LJ B Remote: DL5DI Dir: Incoming
if(preg_match_all('/^(.{19}).*(C[A-Za-z]*).*Rptr: (.{8}).*Remote: (.{8}).*Dir: (.{8})$/',$linkLine,$linx) > 0){
$utc_time = $linx[1][0];
$utc_time = $linx[1][0];
$utc_tz = new DateTimeZone('UTC');
$local_tz = new DateTimeZone(date_default_timezone_get ());
$dt = new DateTime($utc_time, $utc_tz);
$dt->setTimeZone($local_tz);
$local_time = $dt->format('H:i:s M jS');
$linkDate = $local_time;
$linkDate = $local_time;
$linkType = $linx[2][0];
$linkRptr = $linx[3][0];
$linkRem = $linx[4][0];
$linkDir = $linx[5][0];
$ci++;
if($ci > 1) { $ci = 0; }
print "<tr>";
print "<td>$linkRptr</td>";
print "<td>$linkRem</td>";
print "<td>CCS</td>";
print "<td>$linkDir</td>";
print "<td>$linkDate</td>";
print "</tr>\n";
}
}
fclose($linkLog);
$ci++;
if($ci > 1) { $ci = 0; }
print "<tr>";
print "<td>$linkRptr</td>";
print "<td>$linkRem</td>";
print "<td>CCS</td>";
print "<td>$linkDir</td>";
print "<td>$linkDate</td>";
print "</tr>\n";
}
}
fclose($linkLog);
}
print "</table>\n<br />\n";
@@ -84,12 +64,13 @@ if (exec('grep "CCS link" '.$linkLogPath.' | wc -l') >=1) {
$stn_is_set = 0;
for($i = 1;$i < 6; $i++){
$param="starNetCallsign" . $i;
if(isset($configs[$param])) {
$stn_is_set = 1;
break;
}
$param="starNetCallsign" . $i;
if(isset($configs[$param])) {
$stn_is_set = 1;
break;
}
}
if($stn_is_set > 0){
include_once $_SERVER['DOCUMENT_ROOT'].'/dstarrepeater/active_starnet_groups.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/dstarrepeater/active_starnet_groups.php';
}
?>