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 committed by backportbot[bot]
parent 45dcdc3948
commit 0a5045ec8e
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;