add logging in case disk space is low and thus login might fail

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-06-25 00:57:50 +02:00
parent 27dbeec29d
commit 66452b40ff

View file

@ -28,6 +28,12 @@ class AuthManager {
$date = new DateTime(); $date = new DateTime();
$dateTime = $date->getTimestamp(); $dateTime = $date->getTimestamp();
$_SESSION['date_time'] = $dateTime; $_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); file_put_contents(DataConst::GetSessionDateFile(), (string)$dateTime);
} }