From 8878853319106073b5516ca9fb4f8048e8282b03 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Mon, 2 Jan 2023 12:20:15 +1100 Subject: [PATCH] fixed purge bug --- front/php/server/util.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/front/php/server/util.php b/front/php/server/util.php index a8b761a0..8c7f25f4 100755 --- a/front/php/server/util.php +++ b/front/php/server/util.php @@ -165,7 +165,7 @@ function cleanLog($logFile) $path = ""; - $allowedFiles = ['pialert.log', 'pialert_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log']; + $allowedFiles = ['pialert.log', 'pialert_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log', "pialert_pholus.log", "pialert_pholus_lastrun.log"]; if(in_array($logFile, $allowedFiles)) { @@ -179,7 +179,10 @@ function cleanLog($logFile) fwrite($file, "[".$timestamp. "] Log file manually purged" .PHP_EOL.""); fclose($file); displayMessage('File '.$logFile.' purged.', FALSE, TRUE, TRUE, TRUE); - } + } else + { + displayMessage('File '.$logFile.' is not allowed to be purged.', FALSE, TRUE, TRUE, TRUE); + } } // ----------------------------------------------------------------------------------------