diff options
author | Björn Schießle <schiessle@owncloud.com> | 2016-04-18 18:17:08 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2016-04-22 14:55:40 +0200 |
commit | e10105474fbef8940fdfa96d5e2bf2f09b1f0649 (patch) | |
tree | 1881e059a3408a2d4e8096e31719ba989f7dfab1 /apps/federatedfilesharing/lib | |
parent | 606b756a94643eaae87e18b39f6c75e6d18fec7e (diff) | |
download | nextcloud-server-e10105474fbef8940fdfa96d5e2bf2f09b1f0649.tar.gz nextcloud-server-e10105474fbef8940fdfa96d5e2bf2f09b1f0649.zip |
move federated sharing settings to the federatedfilesharing app
Diffstat (limited to 'apps/federatedfilesharing/lib')
-rw-r--r-- | apps/federatedfilesharing/lib/federatedshareprovider.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/apps/federatedfilesharing/lib/federatedshareprovider.php b/apps/federatedfilesharing/lib/federatedshareprovider.php index 78b0b664204..d014a6219a3 100644 --- a/apps/federatedfilesharing/lib/federatedshareprovider.php +++ b/apps/federatedfilesharing/lib/federatedshareprovider.php @@ -25,6 +25,8 @@ namespace OCA\FederatedFileSharing; use OC\Share20\Share; use OCP\Files\IRootFolder; +use OCP\IAppConfig; +use OCP\IConfig; use OCP\IL10N; use OCP\ILogger; use OCP\Share\IShare; @@ -65,6 +67,9 @@ class FederatedShareProvider implements IShareProvider { /** @var IRootFolder */ private $rootFolder; + /** @var IConfig */ + private $config; + /** * DefaultShareProvider constructor. * @@ -75,6 +80,7 @@ class FederatedShareProvider implements IShareProvider { * @param IL10N $l10n * @param ILogger $logger * @param IRootFolder $rootFolder + * @param IConfig $config */ public function __construct( IDBConnection $connection, @@ -83,7 +89,8 @@ class FederatedShareProvider implements IShareProvider { TokenHandler $tokenHandler, IL10N $l10n, ILogger $logger, - IRootFolder $rootFolder + IRootFolder $rootFolder, + IConfig $config ) { $this->dbConnection = $connection; $this->addressHandler = $addressHandler; @@ -92,6 +99,7 @@ class FederatedShareProvider implements IShareProvider { $this->l = $l10n; $this->logger = $logger; $this->rootFolder = $rootFolder; + $this->config = $config; } /** @@ -601,4 +609,24 @@ class FederatedShareProvider implements IShareProvider { // We don't handle groups here return; } + + /** + * check if users from other ownCloud instances are allowed to mount public links share by this instance + * + * @return bool + */ + public function isOutgoingServer2serverShareEnabled() { + $result = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); + return ($result === 'yes') ? true : false; + } + + /** + * check if users are allowed to mount public links from other ownClouds + * + * @return bool + */ + public function isIncomingServer2serverShareEnabled() { + $result = $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes'); + return ($result === 'yes') ? true : false; + } } |