mirror of
https://github.com/michalcz10/USB-RAID-Array.git
synced 2026-11-11 16:09:03 +00:00
revise backend
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user