Merge pull request #848 from nextcloud/public-link-quota

fix getting quota for public links with quota_include_external_storage
This commit is contained in:
Lukas Reschke 2016-08-17 20:13:56 +02:00 committed by GitHub
commit 5aaa065d6d
1 changed files with 13 additions and 1 deletions

View File

@ -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();