From 827b941c49231e51720995746f716378363605b4 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 31 May 2019 17:38:41 +0200 Subject: [PATCH] Show share settings only if incoming federated shares are allowed Fixes #15802 Signed-off-by: Morris Jobke --- .../lib/Settings/Personal.php | 8 +- .../templates/settings-personal.php | 91 +++++++++---------- 2 files changed, 49 insertions(+), 50 deletions(-) diff --git a/apps/federatedfilesharing/lib/Settings/Personal.php b/apps/federatedfilesharing/lib/Settings/Personal.php index d50fa7202f..b4a863931b 100644 --- a/apps/federatedfilesharing/lib/Settings/Personal.php +++ b/apps/federatedfilesharing/lib/Settings/Personal.php @@ -63,7 +63,6 @@ class Personal implements ISettings { $url = 'https://nextcloud.com/sharing#' . $cloudID; $parameters = [ - 'outgoingServer2serverShareEnabled' => $this->federatedShareProvider->isOutgoingServer2serverShareEnabled(), 'message_with_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID, see %s', [$url]), 'message_without_URL' => $this->l->t('Share with me through my #Nextcloud Federated Cloud ID', [$cloudID]), 'logoPath' => $this->defaults->getLogo(), @@ -80,10 +79,11 @@ class Personal implements ISettings { * @since 9.1 */ public function getSection() { - if (!$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { - return null; + if ($this->federatedShareProvider->isIncomingServer2serverShareEnabled() || + $this->federatedShareProvider->isIncomingServer2serverGroupShareEnabled()) { + return 'sharing'; } - return 'sharing'; + return null; } /** diff --git a/apps/federatedfilesharing/templates/settings-personal.php b/apps/federatedfilesharing/templates/settings-personal.php index d11c186374..38ca4e69e8 100644 --- a/apps/federatedfilesharing/templates/settings-personal.php +++ b/apps/federatedfilesharing/templates/settings-personal.php @@ -5,57 +5,56 @@ script('federatedfilesharing', 'settings-personal'); style('federatedfilesharing', 'settings-personal'); ?> - -
-

t('Federated Cloud')); ?>

- -

t('You can share with anyone who uses a Nextcloud server or other Open Cloud Mesh (OCM) compatible servers and services! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com')); ?>

+
+

t('Federated Cloud')); ?>

+ +

t('You can share with anyone who uses a Nextcloud server or other Open Cloud Mesh (OCM) compatible servers and services! Just put their Federated Cloud ID in the share dialog. It looks like person@cloud.example.com')); ?>

-

- t('Your Federated Cloud ID:')); ?> - - -

+

+ t('Your Federated Cloud ID:')); ?> + + +

-
+
-

- t('Share it so your friends can share files with you:')); ?>
- - - - -

+

+ t('Share it so your friends can share files with you:')); ?>
+ + + + +

- - + +
+