diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-09-09 16:56:49 +0300 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-09-09 16:56:49 +0300 |
commit | 29dd7d83c4ec5a82cc75f1da54b4101b2bb986e6 (patch) | |
tree | 72d8abae3095fb9443211497d25f22408733b6e4 | |
parent | a05ccd969c363ba77a8ba8e6b2ddec03cf9b6d1e (diff) |
Check if files_sharing is actually enabled before using it
-rw-r--r-- | ocs/routes.php | 20 |
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 -); + ); +} |