diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 08:30:58 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 08:30:58 +0100 |
commit | fd4742d4308aef6e1d628e19cece5cc04aaee481 (patch) | |
tree | b8cd4ed9be88680f013ba50a5f878ab6e568ff25 /lib | |
parent | e1acad7ae2a47c3aaeca747ceb734bfbc37c87df (diff) | |
parent | 11215f4e275f7e7d1aafdb8af440550d27562ad8 (diff) | |
download | nextcloud-server-fd4742d4308aef6e1d628e19cece5cc04aaee481.tar.gz nextcloud-server-fd4742d4308aef6e1d628e19cece5cc04aaee481.zip |
Merge pull request #22613 from owncloud/quota-changedavreturnvaluewhennoquotaset
Don't return quota when none set
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/helper.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php index 23068330f81..acdd27fc564 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -610,10 +610,12 @@ class OC_Helper { if ($used < 0) { $used = 0; } - $quota = 0; + $quota = \OCP\Files\FileInfo::SPACE_UNLIMITED; $storage = $rootInfo->getStorage(); - if ($includeExtStorage && $storage->instanceOfStorage('\OC\Files\Storage\Shared')) { + $sourceStorage = $storage; + if ($storage->instanceOfStorage('\OC\Files\Storage\Shared')) { $includeExtStorage = false; + $sourceStorage = $storage->getSourceStorage(); } if ($includeExtStorage) { $quota = OC_Util::getUserQuota(\OCP\User::getUser()); @@ -624,9 +626,9 @@ class OC_Helper { } // TODO: need a better way to get total space from storage - if ($storage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) { + if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')) { /** @var \OC\Files\Storage\Wrapper\Quota $storage */ - $quota = $storage->getQuota(); + $quota = $sourceStorage->getQuota(); } $free = $storage->free_space(''); if ($free >= 0) { @@ -654,6 +656,7 @@ class OC_Helper { return [ 'free' => $free, 'used' => $used, + 'quota' => $quota, 'total' => $total, 'relative' => $relative, 'owner' => $ownerId, |