aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2024-12-16 15:53:12 -0800
committerChristopher Ng <chrng8@gmail.com>2025-01-15 15:50:43 -0800
commit1a43fc57181f4ee7403a3a26d29a4e47dab96888 (patch)
treef71ce1009f1ed1e58016b87df7de85bf53bdd445 /apps/settings
parent0eb39d7b9c92712a8083841c227f92dad3d0c86a (diff)
downloadnextcloud-server-1a43fc57181f4ee7403a3a26d29a4e47dab96888.tar.gz
nextcloud-server-1a43fc57181f4ee7403a3a26d29a4e47dab96888.zip
feat(sharing): Toggle custom tokens setting as admin
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Settings/Admin/Sharing.php1
-rw-r--r--apps/settings/src/components/AdminSettingsSharingForm.vue25
2 files changed, 26 insertions, 0 deletions
diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php
index f1c9052f4c3..e001a7d00ea 100644
--- a/apps/settings/lib/Settings/Admin/Sharing.php
+++ b/apps/settings/lib/Settings/Admin/Sharing.php
@@ -71,6 +71,7 @@ class Sharing implements IDelegatedSettings {
'defaultRemoteExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_default_remote_expire_date'),
'remoteExpireAfterNDays' => $this->config->getAppValue('core', 'shareapi_remote_expire_after_n_days', '7'),
'enforceRemoteExpireDate' => $this->getHumanBooleanConfig('core', 'shareapi_enforce_remote_expire_date'),
+ 'allowCustomTokens' => $this->shareManager->allowCustomTokens(),
];
$this->initialState->provideInitialState('sharingAppEnabled', $this->appManager->isEnabledForUser('files_sharing'));
diff --git a/apps/settings/src/components/AdminSettingsSharingForm.vue b/apps/settings/src/components/AdminSettingsSharingForm.vue
index 2d3269563bb..23538b44e6e 100644
--- a/apps/settings/src/components/AdminSettingsSharingForm.vue
+++ b/apps/settings/src/components/AdminSettingsSharingForm.vue
@@ -59,6 +59,24 @@
</label>
</fieldset>
+ <NcCheckboxRadioSwitch type="switch"
+ aria-describedby="settings-sharing-custom-token-disable-hint settings-sharing-custom-token-access-hint"
+ :checked.sync="settings.allowCustomTokens">
+ {{ t('settings', 'Allow users to set custom share link tokens') }}
+ </NcCheckboxRadioSwitch>
+ <div class="sharing__sub-section">
+ <NcNoteCard id="settings-sharing-custom-token-disable-hint"
+ class="sharing__note"
+ type="info">
+ {{ t('settings', 'Shares with custom tokens will continue to be accessible after this setting has been disabled') }}
+ </NcNoteCard>
+ <NcNoteCard id="settings-sharing-custom-token-access-hint"
+ class="sharing__note"
+ type="warning">
+ {{ t('settings', 'Shares with guessable tokens may be accessed easily') }}
+ </NcNoteCard>
+ </div>
+
<label>{{ t('settings', 'Limit sharing based on groups') }}</label>
<div class="sharing__sub-section">
<NcCheckboxRadioSwitch :checked.sync="settings.excludeGroups"
@@ -195,6 +213,7 @@
import {
NcCheckboxRadioSwitch,
NcSettingsSelectGroup,
+ NcNoteCard,
NcTextArea,
NcTextField,
} from '@nextcloud/vue'
@@ -240,6 +259,7 @@ interface IShareSettings {
defaultRemoteExpireDate: boolean
remoteExpireAfterNDays: string
enforceRemoteExpireDate: boolean
+ allowCustomTokens: boolean
}
export default defineComponent({
@@ -247,6 +267,7 @@ export default defineComponent({
components: {
NcCheckboxRadioSwitch,
NcSettingsSelectGroup,
+ NcNoteCard,
NcTextArea,
NcTextField,
SelectSharingPermissions,
@@ -354,6 +375,10 @@ export default defineComponent({
width: 100%;
}
}
+
+ & &__note {
+ margin: 2px 0;
+ }
}
@media only screen and (max-width: 350px) {