diff --git a/apps/federatedfilesharing/lib/FederatedShareProvider.php b/apps/federatedfilesharing/lib/FederatedShareProvider.php
index 5bc18ad4e873..3cfa87343b91 100644
--- a/apps/federatedfilesharing/lib/FederatedShareProvider.php
+++ b/apps/federatedfilesharing/lib/FederatedShareProvider.php
@@ -1065,11 +1065,15 @@ protected function getAccepted($remote, $shareWith) {
'auto_accept_trusted',
'no'
);
+ if ($globalAutoAcceptValue !== 'yes') {
+ return false;
+ }
$autoAccept = $this->config->getUserValue(
$shareWith,
'federatedfilesharing',
'auto_accept_share_trusted',
- $globalAutoAcceptValue);
+ $globalAutoAcceptValue
+ );
if ($autoAccept !== 'yes') {
return false;
}
diff --git a/apps/federatedfilesharing/lib/Panels/AdminPanel.php b/apps/federatedfilesharing/lib/Panels/AdminPanel.php
index 4691292dfe08..238e615a2f26 100644
--- a/apps/federatedfilesharing/lib/Panels/AdminPanel.php
+++ b/apps/federatedfilesharing/lib/Panels/AdminPanel.php
@@ -57,7 +57,7 @@ public function getPanel() {
$tmpl->assign('incomingServer2serverShareEnabled', $this->shareProvider->isIncomingServer2serverShareEnabled());
$tmpl->assign(
'autoAcceptTrusted',
- $this->config->getAppValue('federatedfilesharing', 'auto_accept_trusted', 'no')
+ $this->config->getAppValue('federatedfilesharing', 'auto_accept_trusted', 'no') === 'yes'
);
return $tmpl;
}
diff --git a/apps/federatedfilesharing/lib/Panels/SharingPersonalPanel.php b/apps/federatedfilesharing/lib/Panels/SharingPersonalPanel.php
index 93c8b5941241..20a4146280c6 100644
--- a/apps/federatedfilesharing/lib/Panels/SharingPersonalPanel.php
+++ b/apps/federatedfilesharing/lib/Panels/SharingPersonalPanel.php
@@ -46,17 +46,29 @@ public function __construct(IConfig $config, IUserSession $userSession) {
* @return TemplateResponse | Template
*/
public function getPanel() {
+ $tmpl = new Template('federatedfilesharing', 'settings-personal-sharing');
+ $showEmptyTemplate = true;
+ $globalAutoAcceptShareEnabled = $this->config->getAppValue(
+ 'federatedfilesharing',
+ 'auto_accept_trusted',
+ 'no'
+ );
$autoAcceptShareEnabled = $this->config->getUserValue(
$this->userSession->getUser()->getUID(),
'federatedfilesharing',
'auto_accept_share_trusted',
- 'yes'
- );
- $tmpl = new Template('federatedfilesharing', 'settings-personal-sharing');
- $tmpl->assign(
- 'userAutoAcceptShareTrustedEnabled',
- $autoAcceptShareEnabled
+ $globalAutoAcceptShareEnabled
);
+ if ($globalAutoAcceptShareEnabled === 'yes') {
+ $showEmptyTemplate = false;
+ $tmpl->assign(
+ 'userAutoAcceptShareTrustedEnabled',
+ $autoAcceptShareEnabled
+ );
+ }
+ if ($showEmptyTemplate) {
+ return new Template('federatedfilesharing', 'settings-personal-sharing-empty');
+ }
return $tmpl;
}
diff --git a/apps/federatedfilesharing/templates/settings-personal-sharing-empty.php b/apps/federatedfilesharing/templates/settings-personal-sharing-empty.php
new file mode 100644
index 000000000000..5331e2a8323e
--- /dev/null
+++ b/apps/federatedfilesharing/templates/settings-personal-sharing-empty.php
@@ -0,0 +1,28 @@
+
+ *
+ * @copyright Copyright (c) 2019, ownCloud GmbH
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see
t('Nothing to configure.')); ?>
+