Fix for issue 10862: calculation of free space ignores external storage (doesn't count towards quota)

Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
This commit is contained in:
Felix Nieuwenhuizen 2019-01-26 17:23:23 +01:00 committed by Backportbot
parent a05e578d36
commit 39cbc6e09e
1 changed files with 4 additions and 5 deletions

View File

@ -680,11 +680,10 @@ class Trashbin {
// calculate available space for trash bin // calculate available space for trash bin
// subtract size of files and current trash bin size from quota // subtract size of files and current trash bin size from quota
if ($softQuota) { if ($softQuota) {
$userFolder = \OC::$server->getUserFolder($user); $files_view = new View('/' . $user . '/files');
if(is_null($userFolder)) { $rootInfo = $files_view->getFileInfo('/', false);
return 0; $free = $quota - $rootInfo['size']; // remaining free space for user
}
$free = $quota - $userFolder->getSize(); // remaining free space for user
if ($free > 0) { if ($free > 0) {
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
} else { } else {