Show share settings only if incoming federated shares are allowed

Fixes #15802

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2019-05-31 17:38:41 +02:00 committed by Backportbot
parent f21b9c0df7
commit 827b941c49
2 changed files with 49 additions and 50 deletions

View File

@ -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,11 +79,12 @@ 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 null;
}
/**
* @return int whether the form should be rather on the top or bottom of

View File

@ -5,7 +5,6 @@ script('federatedfilesharing', 'settings-personal');
style('federatedfilesharing', 'settings-personal');
?>
<?php if ($_['outgoingServer2serverShareEnabled']): ?>
<div id="fileSharingSettings" class="section">
<h2 data-anchor-name="federated-cloud"><?php p($l->t('Federated Cloud')); ?></h2>
<a target="_blank" rel="noreferrer noopener" class="icon-info svg"
@ -58,4 +57,4 @@ style('federatedfilesharing', 'settings-personal');
</div>
</div>
<?php endif; ?>