revise backend

This commit is contained in:
Michal Sedlák
2026-10-18 15:55:34 +02:00
parent dc452059f3
commit 99b1c96f4b
23 changed files with 681 additions and 720 deletions
+6 -6
View File
@@ -19,7 +19,7 @@ $SFTP_HOST = '172.16.1.11';
$SFTP_USER = 'usbraid';
$SFTP_PASS = 'usbraid';
// Default remote path – uses session value if set
$defaultPath = $_SESSION['defPath'] ?? '/';
$defaultPath = normalizePath($_SESSION['defPath'] ?? '/');
// SSH credentials (placeholders)
$SSH_HOST = '172.16.1.11';
@@ -29,12 +29,12 @@ $SSH_PASS = 'usbraid';
/** Helper: Get a MySQLi connection */
function getDatabaseConnection(): mysqli {
global $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME;
$conn = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
$database = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if ($database->connect_error) {
die('Connection failed: ' . $database->connect_error);
}
$conn->set_charset('utf8');
return $conn;
$database->set_charset('utf8');
return $database;
}
/** Helper: Initialise SFTP connection */