ACARS portal fixes.

pull/599/head
jprochazka 2024-08-08 12:55:00 -04:00
rodzic 13cdf96bdb
commit 67e24fc5e5
6 zmienionych plików z 33 dodań i 15 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ The following is a history of the changes made to this project.
* Added the ability to reconfigure, rebuild, and reinstall both dump1090-fa and dump978.fa.
* Decoder scripts now ask for device assignments when additional decoders are being installed.
* Added "Contributors" to the copyright notice in the software license.
* Had to remove logging of check_package output due to whiptail issue encountered with pipe.
## v2.8.5 *(July 23rd, 2024)*

Wyświetl plik

@ -200,6 +200,18 @@ check_package libxml2-dev
check_package pkg-config
check_package zlib1g-dev
case $RECEIVER_OS_DISTRIBUTION in
ubuntu)
distro_php_version=""
;;
debian)
if [[ "${RECEIVER_OS_CODE_NAME}" == "bookworm" ]]; then distro_php_version="8.2"; fi
if [[ "${RECEIVER_OS_CODE_NAME}" == "bullseye" ]]; then distro_php_version="7.4"; fi
;;
esac
check_package sqlite3
check_package php${distro_php_version}-sqlite3
case "${device}" in
"RTL-SDR")
check_package librtlsdr-dev

Wyświetl plik

@ -118,7 +118,7 @@ function check_package() {
fi
echo ""
attempt=$((attempt+1))
sudo apt-get install -y $1 2>&1 | tee -a $RECEIVER_LOG_FILE
sudo apt-get install -y $1 #2>&1 | tee -a $RECEIVER_LOG_FILE
echo ""
else
log_true_inline "[OK]"

Wyświetl plik

@ -24,6 +24,17 @@ if ! whiptail --backtitle "${RECEIVER_PROJECT_TITLE}" \
fi
## INSTALL LIGHTTPD IF IT IS NOT ALREADY INSTALLED
log_heading "Installing Lighttpd if not already installed"
check_package lighttpd
log_message "Determining the lighttpd document root"
RAW_DOCUMENT_ROOT=`/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -p | grep server.document-root`
LIGHTTPD_DOCUMENT_ROOT=`sed 's/.*"\(.*\)"[^"]*$/\1/' <<< ${RAW_DOCUMENT_ROOT}`
## GATHER REQUIRED INFORMATION
log_heading "Gather information required to configure the portal"
@ -346,7 +357,7 @@ if [ -f $LIGHTTPD_DOCUMENT_ROOT/index.lighttpd.html ]; then
fi
log_message "Placing portal files in Lighttpd's root directory"
sudo cp -R $PORTAL_BUILD_DIRECTORY/html/* $LIGHTTPD_DOCUMENT_ROOT
sudo cp -R $RECEIVER_BUILD_DIRECTORY/portal//html/* $LIGHTTPD_DOCUMENT_ROOT
if [[ "${RECEIVER_PORTAL_INSTALLED}" = "true" && "${ADVANCED}" = "false" ]]; then
log_message "Restoring the backup copy of the file ${LIGHTTPD_DOCUMENT_ROOT}/data/administrators.xml"

Wyświetl plik

@ -9,6 +9,7 @@
$common = new common();
$template = new template();
$acars = new acars();
$pageData = array();
@ -19,4 +20,4 @@
$acarsMessages = $acars->getAcarsMessages(25, 0);
$template->display($pageData);
?>
?>

Wyświetl plik

@ -2,20 +2,12 @@
class acars {
function getAcarsMessages($limit = 100, $offset = 0) {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php");
$settings = new settings();
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
$dsn = "sqlite:".$settings::acarsserv_database;
$dbh = new PDO($dsn);
$sql = "
SELECT * FROM Messages
JOIN Flights USING(FlightID)
JOIN Stations USING(StID)
ORDER BY LastTime DESC LIMIT 100 OFFSET 0
";
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
$sql = "SELECT * FROM Messages JOIN Flights USING(FlightID) JOIN Stations USING(StID) ORDER BY LastTime DESC LIMIT :limit OFFSET :offset";
$sth = $dbh->prepare($sql);
$sth->bindValue(':limit', $limit);
$sth->bindValue(':offset', $offset);
@ -23,8 +15,9 @@
$acarsMessages = $sth->fetchAll(PDO::FETCH_ASSOC);
$sth = NULL;
$dbh = NULL;
$dsn = NULL;
return $acarsMessages;
}
}
?>
?>