diff options
Diffstat (limited to 'apps/files_trashbin/lib/Trashbin.php')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index a85f761abbd..f73cc1f4aa6 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -569,6 +569,7 @@ class Trashbin { /** * wrapper function to emit the 'preDelete' hook of \OCP\Trashbin before a file is deleted + * * @param string $path */ protected static function emitTrashbinPreDelete($path) { @@ -577,6 +578,7 @@ class Trashbin { /** * wrapper function to emit the 'delete' hook of \OCP\Trashbin after a file has been deleted + * * @param string $path */ protected static function emitTrashbinPostDelete($path) { @@ -693,6 +695,14 @@ class Trashbin { * @return int available free space for trash bin */ 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; + } + $softQuota = true; $userObject = \OC::$server->getUserManager()->get($user); if (is_null($userObject)) { |