diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index fd7f3789bebf2..c5e4b3b3a4816 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 860eb9ed7b2e0..7a7788ec64895 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 7a0253d2be481..a42786b445ba5 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -87,6 +87,7 @@ public function __construct( } public function getForm(): TemplateResponse { + $federationEnabled = $this->appManager->isEnabledForUser('federation'); $federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing'); $lookupServerUploadEnabled = false; if ($federatedFileSharingEnabled) { @@ -119,6 +120,7 @@ public function getForm(): TemplateResponse { '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 eb585c1b68402..dd26412cb51c5 100644 --- a/apps/settings/templates/settings/personal/personal.info.php +++ b/apps/settings/templates/settings/personal/personal.info.php @@ -34,7 +34,8 @@ ]); ?> -