aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Federation
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-05-02 17:15:07 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 11:29:27 +0200
commit6208f250e88a15794ac5b7eeef6d701aa91e131b (patch)
tree7f8a5154a9d1bf9041e0e2fe074b7f6d79b1b5be /lib/private/Federation
parent4c8f3d6d77c5a6bb4a7eced86890039d15d9ca67 (diff)
downloadnextcloud-server-6208f250e88a15794ac5b7eeef6d701aa91e131b.tar.gz
nextcloud-server-6208f250e88a15794ac5b7eeef6d701aa91e131b.zip
check if cloud federation api is ready
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Federation')
-rw-r--r--lib/private/Federation/CloudFederationProviderManager.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/Federation/CloudFederationProviderManager.php b/lib/private/Federation/CloudFederationProviderManager.php
index 925d42a688a..73e1dd99c61 100644
--- a/lib/private/Federation/CloudFederationProviderManager.php
+++ b/lib/private/Federation/CloudFederationProviderManager.php
@@ -22,6 +22,7 @@
namespace OC\Federation;
+use OCP\App\IAppManager;
use OCP\Federation\Exceptions\ProviderAlreadyExistsException;
use OCP\Federation\Exceptions\ProviderDoesNotExistsException;
use OCP\Federation\ICloudFederationNotification;
@@ -41,8 +42,12 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
/** @var array list of available cloud federation providers */
private $cloudFederationProvider;
- public function __construct() {
+ /** @var IAppManager */
+ private $appManager;
+
+ public function __construct(IAppManager $appManager) {
$this->cloudFederationProvider= [];
+ $this->appManager = $appManager;
}
@@ -105,4 +110,13 @@ class CloudFederationProviderManager implements ICloudFederationProviderManager
// TODO: Implement sendNotification() method.
}
+ /**
+ * check if the new cloud federation API is ready to be used
+ *
+ * @return bool
+ */
+ public function isReady() {
+ return $this->appManager->isEnabledForUser('cloud_federation_api', false);
+ }
+
}