summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-08-12 15:59:19 +0200
committerRobin Appelman <robin@icewind.nl>2016-08-12 15:59:19 +0200
commit85d3fb76d7be8894964d98449f3d551a3bc7a810 (patch)
treedecd610f802180387d509ca88f394e53b0673941 /lib
parent35358bdde08d4acd5afbd2ab31bea6aedf416c32 (diff)
downloadnextcloud-server-85d3fb76d7be8894964d98449f3d551a3bc7a810.tar.gz
nextcloud-server-85d3fb76d7be8894964d98449f3d551a3bc7a810.zip
fix getting quota for public links with quota_include_external_storage
Diffstat (limited to 'lib')
-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 62814e495d5..a5f410b87a4 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();