Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-06-12 17:58:30 +0300
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 12:29:30 +0300
commit21b8a873d5c93e5d815fd37bfcbf1d5ed162d12d (patch)
treeffacb98021aff1455720a2342cb3a92348a56e31 /apps/cloud_federation_api
parent9365fd2534eeff4cc0804a1ee794ed89b986bb1d (diff)
implement config check
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/cloud_federation_api')
-rw-r--r--apps/cloud_federation_api/lib/Config.php26
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');
+
}
}