SetFlagFile("./pgs/country.csv"); $Reflector->SetPIDFile($Service['PIDFile']); $Reflector->SetXMLFile($Service['XMLFile']); $Reflector->LoadXML(); // Pre-parse peer reflector data so nav menu can show live counts. // Results are reused by the page files (they check isset() before re-parsing). require_once('./pgs/parse_journal_peers.php'); // These pages need a local peer in xlxd.interlink, hide them (and skip journalctl) without one $InterlinkFile = !empty($CallingHome['InterlinkFile']) ? $CallingHome['InterlinkFile'] : '/xlxd/xlxd.interlink'; foreach (['YSF' => 'YSFPeerPage', 'NXDN' => 'NXDNPeerPage', 'P25' => 'P25PeerPage'] as $PeerType => $PeerPage) { if (!empty($PageOptions[$PeerPage]['Show']) && !HasLocalPeer($PeerType, $InterlinkFile)) { $PageOptions[$PeerPage]['Show'] = false; $PageOptions[$PeerPage]['NoLocalPeer'] = true; } } $YSFPeers = []; if (!empty($PageOptions['YSFPeerPage']['Show'])) { $YSFPeers = ParseJournalPeers($PageOptions['YSFPeerPage']); } $NXDNPeers = []; if (!empty($PageOptions['NXDNPeerPage']['Show'])) { $NXDNPeers = ParseJournalPeers($PageOptions['NXDNPeerPage']); } $P25Peers = []; if (!empty($PageOptions['P25PeerPage']['Show'])) { $P25Peers = ParseJournalPeers($PageOptions['P25PeerPage']); } if ($CallingHome['Active']) { $CallHomeNow = false; $LastSync = 0; $Hash = ""; if (!file_exists($CallingHome['HashFile'])) { $Ressource = fopen($CallingHome['HashFile'], "w+"); if ($Ressource) { $Hash = CreateCode(16); @fwrite($Ressource, "'); @fflush($Ressource); @fclose($Ressource); @chmod($HashFile, 0777); } } else { require_once($CallingHome['HashFile']); } if (@file_exists($CallingHome['LastCallHomefile'])) { if (@is_readable($CallingHome['LastCallHomefile'])) { $tmp = @file($CallingHome['LastCallHomefile']); if (isset($tmp[0])) { $LastSync = $tmp[0]; } unset($tmp); } } if ($LastSync < (time() - $CallingHome['PushDelay'])) { $CallHomeNow = true; $Ressource = @fopen($CallingHome['LastCallHomefile'], "w+"); if ($Ressource) { @fwrite($Ressource, time()); @fflush($Ressource); @fclose($Ressource); @chmod($HashFile, 0777); } } if ($CallHomeNow || isset($_GET['callhome'])) { $Reflector->SetCallingHome($CallingHome, $Hash); $Reflector->ReadInterlinkFile(); $Reflector->PrepareInterlinkXML(); $Reflector->PrepareReflectorXML(); $Reflector->CallHome(); } } else { $Hash = ""; } ?>