diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-24 10:39:04 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-02-29 14:36:20 +0100 |
commit | 11215f4e275f7e7d1aafdb8af440550d27562ad8 (patch) | |
tree | 3d133edb995e6e989d27ad02ef1e518ecb8fea52 /lib/private | |
parent | a38e8b6436ccfe173b4d368d094753c71bdbd69f (diff) | |
download | nextcloud-server-11215f4e275f7e7d1aafdb8af440550d27562ad8.tar.gz nextcloud-server-11215f4e275f7e7d1aafdb8af440550d27562ad8.zip |
Return -3 for unlimited quota
Returns -3 for unlimited quota in Webdav response.
Also adjusted personal page to show unlimited quota when set.
Diffstat (limited to 'lib/private')
-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, |