Change free space calculation

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-08-31 23:10:04 +02:00
parent 8dd249937f
commit 2513b64602
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 6 additions and 4 deletions

View File

@ -708,11 +708,13 @@ class Trashbin {
*/
private static function calculateFreeSpace($trashbinSize, $user) {
$config = \OC::$server->getConfig();
$systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1');
$userTrashbinSize = (int)$config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1');
$configuredTrashbinSize = ($userTrashbinSize < 0) ? $systemTrashbinSize : $userTrashbinSize;
if ($configuredTrashbinSize) {
return $configuredTrashbinSize - $trashbinSize;
if ($userTrashbinSize > -1) {
return $userTrashbinSize - $trashbinSize;
}
$systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1');
if ($systemTrashbinSize > -1) {
return $systemTrashbinSize - $trashbinSize;
}
$softQuota = true;