summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/files/storage/wrapper/quota.php8
-rwxr-xr-xlib/private/util.php2
2 files changed, 8 insertions, 2 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 {
diff --git a/lib/private/util.php b/lib/private/util.php
index 8aa7a074d0d..66a770a33dc 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -65,7 +65,7 @@ class OC_Util {
$user = $storage->getUser()->getUID();
$quota = OC_Util::getUserQuota($user);
if ($quota !== \OC\Files\SPACE_UNLIMITED) {
- return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota));
+ return new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => $quota, 'root' => 'files'));
}
}