summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/api')
-rw-r--r--apps/files_sharing/api/share20ocs.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 5a2af48d6f5..efdd9ecb30e 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -161,6 +161,10 @@ class Share20OCS {
* @return \OC_OCS_Result
*/
public function getShare($id) {
+ if (!$this->shareManager->shareApiEnabled()) {
+ return new \OC_OCS_Result(null, 404, 'Share API is disabled');
+ }
+
try {
$share = $this->getShareById($id);
} catch (ShareNotFound $e) {
@@ -186,7 +190,10 @@ class Share20OCS {
* @return \OC_OCS_Result
*/
public function deleteShare($id) {
- // Try both our default and our federated provider
+ if (!$this->shareManager->shareApiEnabled()) {
+ return new \OC_OCS_Result(null, 404, 'Share API is disabled');
+ }
+
try {
$share = $this->getShareById($id);
} catch (ShareNotFound $e) {
@@ -208,6 +215,10 @@ class Share20OCS {
public function createShare() {
$share = $this->shareManager->newShare();
+ if (!$this->shareManager->shareApiEnabled()) {
+ return new \OC_OCS_Result(null, 404, 'Share API is disabled');
+ }
+
// Verify path
$path = $this->request->getParam('path', null);
if ($path === null) {
@@ -421,6 +432,10 @@ class Share20OCS {
* @return \OC_OCS_Result
*/
public function getShares() {
+ if (!$this->shareManager->shareApiEnabled()) {
+ return new \OC_OCS_Result();
+ }
+
$sharedWithMe = $this->request->getParam('shared_with_me', null);
$reshares = $this->request->getParam('reshares', null);
$subfiles = $this->request->getParam('subfiles');
@@ -478,6 +493,10 @@ class Share20OCS {
* @return \OC_OCS_Result
*/
public function updateShare($id) {
+ if (!$this->shareManager->shareApiEnabled()) {
+ return new \OC_OCS_Result(null, 404, 'Share API is disabled');
+ }
+
try {
$share = $this->getShareById($id);
} catch (ShareNotFound $e) {