summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-11-03 10:17:18 +0100
committerGitHub <noreply@github.com>2021-11-03 10:17:18 +0100
commitd87894a287719043409ac400728e4efe28ca758a (patch)
tree9c0064838dfd225a164c55fbb730c50646f93a09 /apps
parent9c13685ad4cc07b9053ea09bb0ccee51da6e442a (diff)
parent46290e9796d0b0bfe414c6dbad296aa5469b837c (diff)
downloadnextcloud-server-d87894a287719043409ac400728e4efe28ca758a.tar.gz
nextcloud-server-d87894a287719043409ac400728e4efe28ca758a.zip
Merge pull request #29384 from nextcloud/backport/26725/stable21
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/js/federationsettingsview.js13
-rw-r--r--apps/settings/js/settings/personalInfo.js3
-rw-r--r--apps/settings/lib/Settings/Personal/PersonalInfo.php2
-rw-r--r--apps/settings/templates/settings/personal/personal.info.php3
4 files changed, 16 insertions, 5 deletions
diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js
index bb8011aca73..c5e4b3b3a48 100644
--- a/apps/settings/js/federationsettingsview.js
+++ b/apps/settings/js/federationsettingsview.js
@@ -15,7 +15,10 @@
* @constructs FederationScopeMenu
* @memberof OC.Settings
* @param {object} options
- * @param {bool} [options.lookupServerUploadEnabled=false] whether uploading to the lookup server is enabled
+ * @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
*/
var FederationSettingsView = OC.Backbone.View.extend({
_inputFields: undefined,
@@ -31,7 +34,8 @@
} else {
this._config = new OC.Settings.UserSettings();
}
- this.showFederationScopes = !!options.showFederationScopes;
+ this.showFederatedScope = !!options.showFederatedScope;
+ this.showPublishedScope = !!options.showPublishedScope;
this._inputFields = [
'displayname',
@@ -85,8 +89,11 @@
excludedScopes.push('v2-private');
}
- if (!self.showFederationScopes) {
+ 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 a6c57e55d7c..7a7788ec648 100644
--- a/apps/settings/js/settings/personalInfo.js
+++ b/apps/settings/js/settings/personalInfo.js
@@ -204,7 +204,8 @@ window.addEventListener('DOMContentLoaded', function () {
var federationSettingsView = new OC.Settings.FederationSettingsView({
el: settingsEl,
config: userSettings,
- showFederationScopes: !!settingsEl.data('lookup-server-upload-enabled'),
+ showFederatedScope: !!settingsEl.data('federation-enabled'),
+ showPublishedScope: !!settingsEl.data('lookup-server-upload-enabled'),
});
userSettings.on("sync", function() {
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php
index 7a0253d2be4..a42786b445b 100644
--- a/apps/settings/lib/Settings/Personal/PersonalInfo.php
+++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php
@@ -87,6 +87,7 @@ class PersonalInfo implements ISettings {
}
public function getForm(): TemplateResponse {
+ $federationEnabled = $this->appManager->isEnabledForUser('federation');
$federatedFileSharingEnabled = $this->appManager->isEnabledForUser('federatedfilesharing');
$lookupServerUploadEnabled = false;
if ($federatedFileSharingEnabled) {
@@ -119,6 +120,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 eb585c1b684..dd26412cb51 100644
--- a/apps/settings/templates/settings/personal/personal.info.php
+++ b/apps/settings/templates/settings/personal/personal.info.php
@@ -34,7 +34,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>