mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
2aa108000c
commit
0ff83f7230
2 changed files with 13 additions and 0 deletions
|
|
@ -200,4 +200,12 @@ class Quota extends Wrapper {
|
|||
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 {
|
|||
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Wrapper'));
|
||||
$this->assertTrue($this->instance->instanceOfStorage('\OC\Files\Storage\Wrapper\Quota'));
|
||||
}
|
||||
|
||||
public function testNoMkdirQuotaZero() {
|
||||
$instance = $this->getLimitedStorage(0.0);
|
||||
$this->assertFalse($instance->mkdir('foobar'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue