mirror of
https://github.com/nextcloud/server.git
synced 2026-06-15 11:41:20 -04:00
Hide "federated" scope when Federation app is disabled
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 <danxuliu@gmail.com>
This commit is contained in:
parent
e01af52698
commit
222f9f77cd
4 changed files with 12 additions and 1 deletions
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ script('settings', [
|
|||
]);
|
||||
?>
|
||||
|
||||
<div id="personal-settings" data-lookup-server-upload-enabled="<?php p($_['lookupServerUploadEnabled'] ? 'true' : 'false') ?>">
|
||||
<div id="personal-settings" data-federation-enabled="<?php p($_['federationEnabled'] ? 'true' : 'false') ?>"
|
||||
data-lookup-server-upload-enabled="<?php p($_['lookupServerUploadEnabled'] ? 'true' : 'false') ?>">
|
||||
<h2 class="hidden-visually"><?php p($l->t('Personal info')); ?></h2>
|
||||
<div id="personal-settings-avatar-container" class="personal-settings-container">
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue