Skip to content

Commit

Permalink
Merge pull request nextcloud#848 from nextcloud/public-link-quota
Browse files Browse the repository at this point in the history
fix getting quota for public links with quota_include_external_storage
  • Loading branch information
LukasReschke authored Aug 17, 2016
2 parents 6db8ffb + d01a233 commit 2c870bc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/private/legacy/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,19 @@ public static function getStorageInfo($path, $rootInfo = null) {
$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();
Expand Down

0 comments on commit 2c870bc

Please sign in to comment.