Skip to content

Commit

Permalink
refs #21045 avoid getting/setting/displaying unlimited default quota …
Browse files Browse the repository at this point in the history
…if not allowed

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jul 16, 2021
1 parent e98c733 commit 6972429
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions apps/provisioning_api/lib/Controller/AppConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,12 @@ protected function verifyConfigKey(string $app, string $key, string $value) {
if ($app === 'core' && (strpos($key, 'public_') === 0 || strpos($key, 'remote_') === 0)) {
throw new \InvalidArgumentException('The given key can not be set');
}

if ($app === 'files'
&& $key === 'default_quota'
&& $value === 'none'
&& $this->config->getAppValue('files', 'allow_unlimited_quota', '1') === '0') {
throw new \InvalidArgumentException('The given key can not be set');
}
}
}
4 changes: 3 additions & 1 deletion apps/settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ export default {
// convert the preset array into objects
const quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({ id: cur, label: cur }), [])
// add default presets
quotaPreset.unshift(this.unlimitedQuota)
if (this.settings.allowUnlimitedQuota) {
quotaPreset.unshift(this.unlimitedQuota)
}
return quotaPreset
},
// mapping saved values to objects
Expand Down

0 comments on commit 6972429

Please sign in to comment.