Skip to content

Commit

Permalink
refs #21045 add app config to set max quota
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
Julien Veyssier committed Jul 16, 2021
1 parent 2bdb523 commit 0cbad45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/provisioning_api/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,10 @@ public function editUser(string $userId, string $key, string $value): DataRespon
if ($quota === -1) {
$quota = 'none';
} else {
$maxQuota = (int) $this->config->getAppValue('files', 'max_quota', '-1');
if ($maxQuota !== -1 && $quota > $maxQuota) {
throw new OCSException('Invalid quota value '.$value, 102);
}
$quota = \OCP\Util::humanFileSize($quota);
}
}
Expand Down

0 comments on commit 0cbad45

Please sign in to comment.