mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
/data and /tmp standarization
This commit is contained in:
@@ -15,7 +15,19 @@ if (isset($_SESSION["login"]) && $_SESSION["login"] == 1) {
|
||||
|
||||
// Check if a valid cookie is present
|
||||
$CookieSaveLoginName = "NetAlertX_SaveLogin";
|
||||
$config_file = "../../../config/app.conf"; // depends on where this file is called from
|
||||
|
||||
// Use environment-aware config path
|
||||
$configFolderPath = rtrim(getenv('NETALERTX_CONFIG') ?: '/data/config', '/');
|
||||
$config_file = $configFolderPath . '/app.conf';
|
||||
|
||||
// Fallback to legacy path if new location doesn't exist
|
||||
if (!file_exists($config_file)) {
|
||||
$legacyPath = "../../../config/app.conf";
|
||||
if (file_exists($legacyPath)) {
|
||||
$config_file = $legacyPath;
|
||||
}
|
||||
}
|
||||
|
||||
$config_file_lines = file($config_file);
|
||||
$config_file_lines = array_values(preg_grep('/^SETPWD_password.*=/', $config_file_lines));
|
||||
$password_line = explode("'", $config_file_lines[0]);
|
||||
|
||||
Reference in New Issue
Block a user