summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/share/file.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/share/file.php')
-rw-r--r--apps/files_sharing/lib/share/file.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index 113675508fb..38605def73a 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -1,4 +1,6 @@
<?php
+use OCA\FederatedFileSharing\FederatedShareProvider;
+
/**
* @author Andreas Fischer <bantu@owncloud.com>
* @author Bart Visscher <bartv@thisnet.nl>
@@ -40,6 +42,18 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
private $path;
+ /** @var FederatedShareProvider */
+ private $federatedShareProvider;
+
+ public function __construct(FederatedShareProvider $federatedShareProvider = null) {
+ if ($federatedShareProvider) {
+ $this->federatedShareProvider = $federatedShareProvider;
+ } else {
+ $federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application('federatedfilesharing');
+ $this->federatedShareProvider = $federatedSharingApp->getFederatedShareProvider();
+ }
+ }
+
public function isValidSource($itemSource, $uidOwner) {
try {
$path = \OC\Files\Filesystem::getPath($itemSource);
@@ -173,7 +187,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
*/
public function isShareTypeAllowed($shareType) {
if ($shareType === \OCP\Share::SHARE_TYPE_REMOTE) {
- return \OCA\Files_Sharing\Helper::isOutgoingServer2serverShareEnabled();
+ return $this->federatedShareProvider->isOutgoingServer2serverShareEnabled();
}
return true;