Do not include mountpoints when calculating quota usage on WebDAV

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/19436/head
Julius Härtl 5 years ago
parent 797fa188c2
commit 902d12555e
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  1. 3
      apps/dav/lib/Connector/Sabre/Directory.php
  2. 8
      apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php

@ -326,7 +326,8 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node implements \Sabre\DAV\ICol
return $this->quotaInfo;
}
try {
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $this->info);
$info = $this->fileView->getFileInfo($this->path, false);
$storageInfo = \OC_Helper::getStorageInfo($this->info->getPath(), $info);
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
$free = \OCP\Files\FileInfo::SPACE_UNLIMITED;
} else {

@ -295,6 +295,10 @@ class DirectoryTest extends \Test\TestCase {
->method('getStorage')
->willReturn($storage);
$this->view->expects($this->once())
->method('getFileInfo')
->willReturn($this->info);
$dir = new Directory($this->view, $this->info);
$this->assertEquals([200, -3], $dir->getQuotaInfo()); //200 used, unlimited
}
@ -327,6 +331,10 @@ class DirectoryTest extends \Test\TestCase {
->method('getStorage')
->willReturn($storage);
$this->view->expects($this->once())
->method('getFileInfo')
->willReturn($this->info);
$dir = new Directory($this->view, $this->info);
$this->assertEquals([200, 800], $dir->getQuotaInfo()); //200 used, 800 free
}

Loading…
Cancel
Save