diff --git a/ajax/system/sys_debug.php b/ajax/system/sys_debug.php index 8390dafc..e596ea1b 100644 --- a/ajax/system/sys_debug.php +++ b/ajax/system/sys_debug.php @@ -7,17 +7,16 @@ if (isset($_POST['csrf_token'])) { if (csrfValidateRequest() && !CSRFValidate()) { handleInvalidCSRFToken(); } - exec( RASPI_CONFIG.'/system/debuglog.sh', $return); + $root = getenv("DOCUMENT_ROOT"); + exec( RASPI_CONFIG.'/system/debuglog.sh -i '.$root, $return); $logOutput = implode(PHP_EOL, $return); - $filename = "raspap_debug.log"; $tempDir = sys_get_temp_dir(); - $filePath = $tempDir . DIRECTORY_SEPARATOR . $filename; + $filePath = $tempDir . DIRECTORY_SEPARATOR . RASPI_DEBUG_LOG; $handle = fopen($filePath, "w"); fwrite($handle, $logOutput); fclose($handle); echo json_encode($filePath); - } else { handleInvalidCSRFToken(); } diff --git a/ajax/system/sys_get_logfile.php b/ajax/system/sys_get_logfile.php index 7bcb3445..92309696 100644 --- a/ajax/system/sys_get_logfile.php +++ b/ajax/system/sys_get_logfile.php @@ -1,11 +1,11 @@ RASPI_CONFIG.'/raspap.auth', 'RASPI_WIFI_AP_INTERFACE' => 'wlan0', 'RASPI_CACHE_PATH' => sys_get_temp_dir() . '/raspap', + 'RASPI_DEBUG_LOG' => 'raspap_debug.log', // Constants for configuration file paths. // These are typical for default RPi installs. Modify if needed.