fix quota calculation for trash and versions

This commit is contained in:
Björn Schießle 2013-03-04 12:17:57 +01:00
parent 36a1bcb732
commit 94dab96dba
2 changed files with 5 additions and 5 deletions

View file

@ -108,7 +108,7 @@ class Trashbin {
if ( $quota === null || $quota === 'default') {
$quota = \OC_Appconfig::getValue('files', 'default_quota');
}
if ( $quota === null ) {
if ( $quota === null || $quote === 'none' ) {
$quota = \OC\Files\Filesystem::free_space('/') / count(\OCP\User::getUsers());
} else {
$quota = \OCP\Util::computerFileSize($quota);

View file

@ -351,16 +351,16 @@ class Storage {
$versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
// get available disk space for user
$quota = \OC_Preferences::getValue($uid, 'files', 'quota');
if ( $quota === null ) {
$quota = \OC_Preferences::getValue($user, 'files', 'quota');
if ( $quota === null || $quota === 'default') {
$quota = \OC_Appconfig::getValue('files', 'default_quota');
}
if ( $quota === null ) {
if ( $quota === null || $quote === 'none' ) {
$quota = \OC\Files\Filesystem::free_space('/') / count(\OCP\User::getUsers());
} else {
$quota = \OCP\Util::computerFileSize($quota);
}
// make sure that we have the current size of the version history
if ( $versionsSize === null ) {
$versionsSize = self::getVersionsSize($uid);