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 <[email protected]>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
  • Loading branch information
Julien Veyssier authored and npmbuildbot-nextcloud[bot] committed Jul 19, 2021
1 parent 8cd57de commit d26c684
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
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: 2 additions & 2 deletions apps/settings/js/vue-settings-apps-users-management.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/settings/js/vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions apps/settings/js/vue-settings-users-a086f4bfa15a702efa12.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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 d26c684

Please sign in to comment.