diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-06-12 16:58:30 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-02 11:29:30 +0200 |
commit | 21b8a873d5c93e5d815fd37bfcbf1d5ed162d12d (patch) | |
tree | ffacb98021aff1455720a2342cb3a92348a56e31 /apps | |
parent | 9365fd2534eeff4cc0804a1ee794ed89b986bb1d (diff) | |
download | nextcloud-server-21b8a873d5c93e5d815fd37bfcbf1d5ed162d12d.tar.gz nextcloud-server-21b8a873d5c93e5d815fd37bfcbf1d5ed162d12d.zip |
implement config check
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cloud_federation_api/lib/Config.php | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/apps/cloud_federation_api/lib/Config.php b/apps/cloud_federation_api/lib/Config.php index 90c36a4f792..386f27b199a 100644 --- a/apps/cloud_federation_api/lib/Config.php +++ b/apps/cloud_federation_api/lib/Config.php @@ -21,6 +21,8 @@ namespace OCA\CloudFederationAPI; +use OCP\GlobalScale\IConfig as IGsConfig; +use OCP\IConfig; /** @@ -32,15 +34,33 @@ namespace OCA\CloudFederationAPI; */ class Config { - public function __construct() { + /** @var IGsConfig */ + private $gsConfig; + + /** @var IConfig */ + private $config; + + public function __construct(IGsConfig $globalScaleConfig, IConfig $config) { + $this->gsConfig = $globalScaleConfig; + $this->config = $config; } public function incomingRequestsEnabled() { - return true; + if ($this->gsConfig->onlyInternalFederation()) { + return false; + } + $result = $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes'); + return ($result === 'yes'); } public function outgoingRequestsEnabled() { - return true; + + if ($this->gsConfig->onlyInternalFederation()) { + return false; + } + $result = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); + return ($result === 'yes'); + } } |