From 66452b40ffb6a80257f6e7d4bf8cb0db98b7f950 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sun, 25 Jun 2023 00:57:50 +0200 Subject: [PATCH] add logging in case disk space is low and thus login might fail Signed-off-by: Simon L --- php/src/Auth/AuthManager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/php/src/Auth/AuthManager.php b/php/src/Auth/AuthManager.php index 5ee6c267..88bdab10 100644 --- a/php/src/Auth/AuthManager.php +++ b/php/src/Auth/AuthManager.php @@ -28,6 +28,12 @@ class AuthManager { $date = new DateTime(); $dateTime = $date->getTimestamp(); $_SESSION['date_time'] = $dateTime; + + $df = disk_free_space(DataConst::GetSessionDirectory()); + if ($df !== false && (int)$df < 10240) { + error_log(DataConst::GetSessionDirectory() . " has only less than 10KB free space. The login might not succeed because of that!"); + } + file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime); }