summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/helper.php')
-rw-r--r--lib/private/legacy/helper.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/private/legacy/helper.php b/lib/private/legacy/helper.php
index da562034959..b19e58a9e6c 100644
--- a/lib/private/legacy/helper.php
+++ b/lib/private/legacy/helper.php
@@ -588,7 +588,19 @@ class OC_Helper {
$sourceStorage = $storage->getSourceStorage();
}
if ($includeExtStorage) {
- $quota = OC_Util::getUserQuota(\OCP\User::getUser());
+ if ($storage->instanceOfStorage('\OC\Files\Storage\Home')
+ || $storage->instanceOfStorage('\OC\Files\ObjectStore\HomeObjectStoreStorage')
+ ) {
+ /** @var \OC\Files\Storage\Home $storage */
+ $user = $storage->getUser();
+ } else {
+ $user = \OC::$server->getUserSession()->getUser()->getUID();
+ }
+ if ($user) {
+ $quota = OC_Util::getUserQuota($user);
+ } else {
+ $quota = \OCP\Files\FileInfo::SPACE_UNLIMITED;
+ }
if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
// always get free space / total space from root + mount points
return self::getGlobalStorageInfo();