Skip to content
Snippets Groups Projects
Unverified Commit 0ff83f72 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Do not allow folder creation with quota of 0


Fixes #4577

Users with a quota of 0 are a special case. Since they can't (ever)
create files on their own storage. Therefor it makes no real that they
can create folders (and possible share those etc).

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent 2aa10800
No related branches found
No related tags found
No related merge requests found
...@@ -200,4 +200,12 @@ class Quota extends Wrapper { ...@@ -200,4 +200,12 @@ class Quota extends Wrapper {
return false; return false;
} }
} }
public function mkdir($path) {
if ($this->quota === 0.0) {
return false;
}
return parent::mkdir($path);
}
} }
...@@ -208,4 +208,9 @@ class QuotaTest extends \Test\Files\Storage\Storage { ...@@ -208,4 +208,9 @@ class QuotaTest extends \Test\Files\Storage\Storage {
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper')); $this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota')); $this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota'));
} }
public function testNoMkdirQuotaZero() {
$instance = $this->getLimitedStorage(0.0);
$this->assertFalse($instance->mkdir('foobar'));
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment