diff options
author | Pytal <24800714+Pytal@users.noreply.github.com> | 2022-10-27 17:52:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-27 17:52:48 -0700 |
commit | c723daaa561f621496a416e20a7988727303580c (patch) | |
tree | 4f2ca534a4d41d6d1c911e504e96dcf51bbe751a /apps | |
parent | d007088cf5d89e29065991e0cbe2c890dfa13d96 (diff) | |
parent | 531bb62223b1ec30bbfb69129effc9f87187bf52 (diff) | |
download | nextcloud-server-c723daaa561f621496a416e20a7988727303580c.tar.gz nextcloud-server-c723daaa561f621496a416e20a7988727303580c.zip |
Merge pull request #34785 from nextcloud/fix/federated-scope
Fix disabled federated scope
Diffstat (limited to 'apps')
4 files changed, 20 insertions, 12 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 56291cd3d35..0a65ebe2c74 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -138,7 +138,6 @@ class PersonalInfo implements ISettings { $messageParameters = $this->getMessageParameters($account); $parameters = [ - 'federationEnabled' => $federationEnabled, 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, 'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(), 'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(), @@ -171,6 +170,7 @@ class PersonalInfo implements ISettings { $accountParameters = [ 'avatarChangeSupported' => $user->canChangeAvatar(), 'displayNameChangeSupported' => $user->canChangeDisplayName(), + 'federationEnabled' => $federationEnabled, 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, ]; diff --git a/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue b/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue index 555b917ad1f..ea22ddf873f 100644 --- a/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue +++ b/apps/settings/src/components/PersonalInfo/shared/FederationControl.vue @@ -57,7 +57,10 @@ import { import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService.js' import logger from '../../../logger.js' -const { lookupServerUploadEnabled } = loadState('settings', 'accountParameters', {}) +const { + federationEnabled, + lookupServerUploadEnabled, +} = loadState('settings', 'accountParameters', {}) export default { name: 'FederationControl', @@ -120,15 +123,21 @@ export default { }, supportedScopes() { - if (lookupServerUploadEnabled && !UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) { - return [ - ...PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable], - SCOPE_ENUM.FEDERATED, - SCOPE_ENUM.PUBLISHED, - ] + const scopes = PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable] + + if (UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) { + return scopes + } + + if (federationEnabled) { + scopes.push(SCOPE_ENUM.FEDERATED) + } + + if (lookupServerUploadEnabled) { + scopes.push(SCOPE_ENUM.PUBLISHED) } - return PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable] + return scopes }, }, diff --git a/apps/settings/src/constants/AccountPropertyConstants.js b/apps/settings/src/constants/AccountPropertyConstants.js index 17166d1305f..6be683dcb91 100644 --- a/apps/settings/src/constants/AccountPropertyConstants.js +++ b/apps/settings/src/constants/AccountPropertyConstants.js @@ -175,7 +175,7 @@ export const SCOPE_PROPERTY_ENUM = Object.freeze({ name: SCOPE_ENUM.FEDERATED, displayName: t('settings', 'Federated'), tooltip: t('settings', 'Only synchronize to trusted servers'), - tooltipDisabled: t('settings', 'Not available as publishing user specific data to the lookup server is not allowed, contact your system administrator if you have any questions'), + tooltipDisabled: t('settings', 'Not available as federation has been disabled for your account, contact your system administrator if you have any questions'), iconClass: 'icon-contacts-dark', }, [SCOPE_ENUM.PUBLISHED]: { diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index 3426cf4ebeb..0ea5258c0f5 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -43,8 +43,7 @@ script('settings', [ </div> <?php endif; ?> -<div id="personal-settings" data-federation-enabled="<?php p($_['federationEnabled'] ? 'true' : 'false') ?>" - data-lookup-server-upload-enabled="<?php p($_['lookupServerUploadEnabled'] ? 'true' : 'false') ?>"> +<div id="personal-settings"> <h2 class="hidden-visually"><?php p($l->t('Personal info')); ?></h2> <div id="personal-settings-avatar-container" class="personal-settings-container"> <div id="vue-avatar-section"></div> |