summaryrefslogtreecommitdiffstats
path: root/apps/federation/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-27 08:13:47 +0200
committerJoas Schilling <coding@schilljs.com>2021-04-27 08:13:47 +0200
commit1029abc8f6e6935680303ffdb57c9c6fb11c4039 (patch)
treef3913b7b7ad6624804d523f32545ffd08dff76c4 /apps/federation/lib
parent3f0b7fd289bf6fd9a9200c63160d1133618b2583 (diff)
downloadnextcloud-server-1029abc8f6e6935680303ffdb57c9c6fb11c4039.tar.gz
nextcloud-server-1029abc8f6e6935680303ffdb57c9c6fb11c4039.zip
More cleaning after auto-add removal
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federation/lib')
-rw-r--r--apps/federation/lib/Hooks.php47
-rw-r--r--apps/federation/lib/Settings/Admin.php1
-rw-r--r--apps/federation/lib/TrustedServers.php22
3 files changed, 0 insertions, 70 deletions
diff --git a/apps/federation/lib/Hooks.php b/apps/federation/lib/Hooks.php
deleted file mode 100644
index f02409ef242..00000000000
--- a/apps/federation/lib/Hooks.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Björn Schießle <bjoern@schiessle.org>
- *
- * @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 <http://www.gnu.org/licenses/>
- *
- */
-
-namespace OCA\Federation;
-
-class Hooks {
-
- /** @var TrustedServers */
- private $trustedServers;
-
- public function __construct(TrustedServers $trustedServers) {
- $this->trustedServers = $trustedServers;
- }
-
- /**
- * add servers to the list of trusted servers once a federated share was established
- *
- * @param array $params
- */
- public function addServerHook($params) {
- if (
- $this->trustedServers->getAutoAddServers() === true &&
- $this->trustedServers->isTrustedServer($params['server']) === false
- ) {
- $this->trustedServers->addServer($params['server']);
- }
- }
-}
diff --git a/apps/federation/lib/Settings/Admin.php b/apps/federation/lib/Settings/Admin.php
index 9dd06dc8f53..af4addecc41 100644
--- a/apps/federation/lib/Settings/Admin.php
+++ b/apps/federation/lib/Settings/Admin.php
@@ -42,7 +42,6 @@ class Admin implements ISettings {
public function getForm() {
$parameters = [
'trustedServers' => $this->trustedServers->getServers(),
- 'autoAddServers' => $this->trustedServers->getAutoAddServers(),
];
return new TemplateResponse('federation', 'settings-admin', $parameters, '');
diff --git a/apps/federation/lib/TrustedServers.php b/apps/federation/lib/TrustedServers.php
index 92454e03a55..29b58555238 100644
--- a/apps/federation/lib/TrustedServers.php
+++ b/apps/federation/lib/TrustedServers.php
@@ -131,28 +131,6 @@ class TrustedServers {
}
/**
- * enable/disable to automatically add servers to the list of trusted servers
- * once a federated share was created and accepted successfully
- *
- * @param bool $status
- */
- public function setAutoAddServers($status) {
- $value = $status ? '1' : '0';
- $this->config->setAppValue('federation', 'autoAddServers', $value);
- }
-
- /**
- * return if we automatically add servers to the list of trusted servers
- * once a federated share was created and accepted successfully
- *
- * @return bool
- */
- public function getAutoAddServers() {
- $value = $this->config->getAppValue('federation', 'autoAddServers', '0');
- return $value === '1';
- }
-
- /**
* get shared secret for the given server
*
* @param string $url