aboutsummaryrefslogtreecommitdiffstats
path: root/ocs
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-09 14:56:49 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-09 14:56:49 +0100
commit29dd7d83c4ec5a82cc75f1da54b4101b2bb986e6 (patch)
tree72d8abae3095fb9443211497d25f22408733b6e4 /ocs
parenta05ccd969c363ba77a8ba8e6b2ddec03cf9b6d1e (diff)
downloadnextcloud-server-29dd7d83c4ec5a82cc75f1da54b4101b2bb986e6.tar.gz
nextcloud-server-29dd7d83c4ec5a82cc75f1da54b4101b2bb986e6.zip
Check if files_sharing is actually enabled before using it
Diffstat (limited to 'ocs')
-rw-r--r--ocs/routes.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/ocs/routes.php b/ocs/routes.php
index f8e6f33c48a..9a8625bcc31 100644
--- a/ocs/routes.php
+++ b/ocs/routes.php
@@ -104,31 +104,33 @@ API::register(
);
// Server-to-Server Sharing
-$s2s = new \OCA\Files_Sharing\API\Server2Server();
-API::register('post',
+if (\OC::$server->getAppManager()->isEnabledForUser('files_sharing')) {
+ $s2s = new \OCA\Files_Sharing\API\Server2Server();
+ API::register('post',
'/cloud/shares',
array($s2s, 'createShare'),
'files_sharing',
API::GUEST_AUTH
-);
+ );
-API::register('post',
+ API::register('post',
'/cloud/shares/{id}/accept',
array($s2s, 'acceptShare'),
'files_sharing',
API::GUEST_AUTH
-);
+ );
-API::register('post',
+ API::register('post',
'/cloud/shares/{id}/decline',
array($s2s, 'declineShare'),
'files_sharing',
API::GUEST_AUTH
-);
+ );
-API::register('post',
+ API::register('post',
'/cloud/shares/{id}/unshare',
array($s2s, 'unshare'),
'files_sharing',
API::GUEST_AUTH
-);
+ );
+}