summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper/quota.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-01-27 15:41:56 +0100
committerRobin Appelman <icewind@owncloud.com>2014-01-27 15:41:56 +0100
commita521949bafdaba0cb94061967b6b8307bbbebc05 (patch)
tree62ddb3df37ca695ed4ff40b79594cbf26f4f561e /lib/private/files/storage/wrapper/quota.php
parentd182b4f59fd7b172764a4d802dbd3ee6a953ea39 (diff)
downloadnextcloud-server-a521949bafdaba0cb94061967b6b8307bbbebc05.tar.gz
nextcloud-server-a521949bafdaba0cb94061967b6b8307bbbebc05.zip
Allow passing a root folder to get the used space from in the quota wrapper
Diffstat (limited to 'lib/private/files/storage/wrapper/quota.php')
-rw-r--r--lib/private/files/storage/wrapper/quota.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index a430e3e4617..83a5de5ca30 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -16,11 +16,17 @@ class Quota extends Wrapper {
protected $quota;
/**
+ * @var string $freeSpaceRoot
+ */
+ protected $sizeRoot;
+
+ /**
* @param array $parameters
*/
public function __construct($parameters) {
$this->storage = $parameters['storage'];
$this->quota = $parameters['quota'];
+ $this->freeSpaceRoot = isset($parameters['root']) ? $parameters['root'] : '';
}
protected function getSize($path) {
@@ -43,7 +49,7 @@ class Quota extends Wrapper {
if ($this->quota < 0) {
return $this->storage->free_space($path);
} else {
- $used = $this->getSize('');
+ $used = $this->getSize($this->freeSpaceRoot);
if ($used < 0) {
return \OC\Files\SPACE_NOT_COMPUTED;
} else {