Skip to content

Commit 0cb14bd

Browse files
authored
Merge pull request #34862 from nextcloud/backport/34785/stable25
[stable25] Fix disabled federated scope
2 parents 3289739 + adc106a commit 0cb14bd

File tree

8 files changed

+26
-18
lines changed

8 files changed

+26
-18
lines changed

apps/settings/lib/Settings/Personal/PersonalInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public function getForm(): TemplateResponse {
138138
$messageParameters = $this->getMessageParameters($account);
139139

140140
$parameters = [
141-
'federationEnabled' => $federationEnabled,
142141
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
143142
'isFairUseOfFreePushService' => $this->isFairUseOfFreePushService(),
144143
'profileEnabledGlobally' => $this->profileManager->isProfileEnabled(),
@@ -171,6 +170,7 @@ public function getForm(): TemplateResponse {
171170
$accountParameters = [
172171
'avatarChangeSupported' => $user->canChangeAvatar(),
173172
'displayNameChangeSupported' => $user->canChangeDisplayName(),
173+
'federationEnabled' => $federationEnabled,
174174
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
175175
];
176176

apps/settings/src/components/PersonalInfo/shared/FederationControl.vue

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ import {
5757
import { savePrimaryAccountPropertyScope } from '../../../service/PersonalInfo/PersonalInfoService.js'
5858
import logger from '../../../logger.js'
5959
60-
const { lookupServerUploadEnabled } = loadState('settings', 'accountParameters', {})
60+
const {
61+
federationEnabled,
62+
lookupServerUploadEnabled,
63+
} = loadState('settings', 'accountParameters', {})
6164
6265
export default {
6366
name: 'FederationControl',
@@ -120,15 +123,21 @@ export default {
120123
},
121124
122125
supportedScopes() {
123-
if (lookupServerUploadEnabled && !UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) {
124-
return [
125-
...PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable],
126-
SCOPE_ENUM.FEDERATED,
127-
SCOPE_ENUM.PUBLISHED,
128-
]
126+
const scopes = PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable]
127+
128+
if (UNPUBLISHED_READABLE_PROPERTIES.includes(this.readable)) {
129+
return scopes
130+
}
131+
132+
if (federationEnabled) {
133+
scopes.push(SCOPE_ENUM.FEDERATED)
134+
}
135+
136+
if (lookupServerUploadEnabled) {
137+
scopes.push(SCOPE_ENUM.PUBLISHED)
129138
}
130139
131-
return PROPERTY_READABLE_SUPPORTED_SCOPES_ENUM[this.readable]
140+
return scopes
132141
},
133142
},
134143

apps/settings/src/constants/AccountPropertyConstants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const SCOPE_PROPERTY_ENUM = Object.freeze({
175175
name: SCOPE_ENUM.FEDERATED,
176176
displayName: t('settings', 'Federated'),
177177
tooltip: t('settings', 'Only synchronize to trusted servers'),
178-
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'),
178+
tooltipDisabled: t('settings', 'Not available as federation has been disabled for your account, contact your system administrator if you have any questions'),
179179
iconClass: 'icon-contacts-dark',
180180
},
181181
[SCOPE_ENUM.PUBLISHED]: {

apps/settings/templates/settings/personal/personal.info.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
</div>
4444
<?php endif; ?>
4545

46-
<div id="personal-settings" data-federation-enabled="<?php p($_['federationEnabled'] ? 'true' : 'false') ?>"
47-
data-lookup-server-upload-enabled="<?php p($_['lookupServerUploadEnabled'] ? 'true' : 'false') ?>">
46+
<div id="personal-settings">
4847
<h2 class="hidden-visually"><?php p($l->t('Personal info')); ?></h2>
4948
<div id="personal-settings-avatar-container" class="personal-settings-container">
5049
<div id="vue-avatar-section"></div>

dist/settings-vue-settings-admin-basic-settings.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-admin-basic-settings.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-personal-info.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-personal-info.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)