[stable16] Show share settings only if incoming federated shares are allowed (#15926)

[stable16] Show share settings only if incoming federated shares are allowed
This commit is contained in:
John Molakvoæ 2019-06-12 08:58:49 +02:00 committed by GitHub
commit 9dfe777fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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; ?>