From 2c70e4689af774d010a1106bf17559071ee926e0 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Fri, 16 Apr 2021 18:24:40 +0200 Subject: Fix "Federated" scope not shown when the lookup server is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the lookup server is disabled the address books can still be exchanged between trusted servers. Therefore the user should be able to set the "Federated" scope in that case. Signed-off-by: Daniel Calviño Sánchez --- apps/settings/js/federationsettingsview.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/settings/js/federationsettingsview.js') diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index 602acab5c8d..58e2583546c 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -15,7 +15,8 @@ * @constructs FederationScopeMenu * @memberof OC.Settings * @param {object} options - * @param {bool} [options.lookupServerUploadEnabled=false] whether uploading to the lookup server is enabled + * @param {bool} [options.showPublishedScope=false] whether show the + * "v2-published" scope or not */ var FederationSettingsView = OC.Backbone.View.extend({ _inputFields: undefined, @@ -31,7 +32,7 @@ } else { this._config = new OC.Settings.UserSettings(); } - this.showFederationScopes = !!options.showFederationScopes; + this.showPublishedScope = !!options.showPublishedScope; this._inputFields = [ 'displayname', @@ -85,8 +86,7 @@ excludedScopes.push('v2-private'); } - if (!self.showFederationScopes) { - excludedScopes.push('v2-federated'); + if (!self.showPublishedScope) { excludedScopes.push('v2-published'); } -- cgit v1.2.3 From 1e19b1cc994d38b19a29494cc1579fe3182a34bd Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Thu, 24 Jun 2021 01:46:44 +0200 Subject: Hide "federated" scope when Federation app is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the Federation app is disabled it is not possible to synchronize the users from a different server. Signed-off-by: Daniel Calviño Sánchez --- apps/settings/js/federationsettingsview.js | 7 +++++++ apps/settings/js/settings/personalInfo.js | 1 + apps/settings/lib/Settings/Personal/PersonalInfo.php | 2 ++ apps/settings/templates/settings/personal/personal.info.php | 3 ++- 4 files changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/settings/js/federationsettingsview.js') diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index 58e2583546c..ca56992b1ed 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -15,6 +15,8 @@ * @constructs FederationScopeMenu * @memberof OC.Settings * @param {object} options + * @param {bool} [options.showFederatedScope=false] whether show the + * "v2-federated" scope or not * @param {bool} [options.showPublishedScope=false] whether show the * "v2-published" scope or not */ @@ -32,6 +34,7 @@ } else { this._config = new OC.Settings.UserSettings(); } + this.showFederatedScope = !!options.showFederatedScope; this.showPublishedScope = !!options.showPublishedScope; this._inputFields = [ @@ -86,6 +89,10 @@ excludedScopes.push('v2-private'); } + if (!self.showFederatedScope) { + excludedScopes.push('v2-federated'); + } + if (!self.showPublishedScope) { excludedScopes.push('v2-published'); } diff --git a/apps/settings/js/settings/personalInfo.js b/apps/settings/js/settings/personalInfo.js index 72ce39d5693..dcac153c1f6 100644 --- a/apps/settings/js/settings/personalInfo.js +++ b/apps/settings/js/settings/personalInfo.js @@ -204,6 +204,7 @@ window.addEventListener('DOMContentLoaded', function () { var federationSettingsView = new OC.Settings.FederationSettingsView({ el: settingsEl, config: userSettings, + showFederatedScope: !!settingsEl.data('federation-enabled'), showPublishedScope: !!settingsEl.data('lookup-server-upload-enabled'), }); diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index 387843c5522..fede5c4f594 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -92,6 +92,7 @@ class PersonalInfo implements ISettings { } public function getForm(): TemplateResponse { + $federationEnabled = $this->appManager->isEnabledForUser('federation'); $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); $lookupServerUploadEnabled = false; if ($federatedFileSharingEnabled) { @@ -124,6 +125,7 @@ class PersonalInfo implements ISettings { 'usage_relative' => round($storageInfo['relative']), 'quota' => $storageInfo['quota'], 'avatarChangeSupported' => $user->canChangeAvatar(), + 'federationEnabled' => $federationEnabled, 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, 'avatarScope' => $account->getProperty(IAccountManager::PROPERTY_AVATAR)->getScope(), 'displayNameChangeSupported' => $user->canChangeDisplayName(), diff --git a/apps/settings/templates/settings/personal/personal.info.php b/apps/settings/templates/settings/personal/personal.info.php index 23ee1ca0367..c1a5735aa8f 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -35,7 +35,8 @@ script('settings', [ ]); ?> -
+

t('Personal info')); ?>

-- cgit v1.2.3