Merge pull request #2857 from nextcloud/enh/noid/add-low-disk-space-warning

add logging in case disk space is low and thus login might fail
This commit is contained in:
Simon L 2023-06-26 12:41:08 +02:00 committed by GitHub
commit addb52fd8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}