summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/trash.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/trash.php')
-rw-r--r--apps/files_trashbin/lib/trash.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index a04545e3261..d4d5ad96cfa 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -96,20 +96,21 @@ class Trashbin {
$view->rename($keyfile.'.key', 'files_trashbin/keyfiles/'. $deleted.'.key.d'.$timestamp);
}
}
-
} else {
\OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin', \OC_log::ERROR);
}
// get available disk space for user
- $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($user, 'files', 'quota'));
+ $quota = \OC_Preferences::getValue($user, 'files', 'quota');
if ( $quota === null ) {
- $quota = \OCP\Util::computerFileSize(\OC_Appconfig::getValue('files', 'default_quota'));
+ $quota = \OC_Appconfig::getValue('files', 'default_quota');
}
if ( $quota === null ) {
$quota = \OC\Files\Filesystem::free_space('/') / count(\OCP\User::getUsers());
+ } else {
+ $quota = \OCP\Util::computerFileSize($quota);
}
-
+
// calculate available space for trash bin
$rootInfo = $view->getFileInfo('/files');
$free = $quota-$rootInfo['size']; // remaining free space for user
@@ -118,7 +119,6 @@ class Trashbin {
} else {
$availableSpace = $free-$trashbinSize;
}
-
$trashbinSize -= self::expire($availableSpace);
self::setTrashbinSize($user, $trashbinSize);