diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-01-26 16:14:05 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-02-04 14:56:31 +0100 |
commit | ea1f726b7defe1161e22c3d2972d85fbb530d182 (patch) | |
tree | 2a43bd4b8b081ea41f162811c9236f7731aad4eb /apps/files_sharing | |
parent | b3ea849a8704d29fad0a738af8af3430ebb5b3af (diff) | |
download | nextcloud-server-ea1f726b7defe1161e22c3d2972d85fbb530d182.tar.gz nextcloud-server-ea1f726b7defe1161e22c3d2972d85fbb530d182.zip |
Only return capabilities if they are set
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/capabilities.php | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php index 712eb2317b4..25b0484b2ee 100644 --- a/apps/files_sharing/lib/capabilities.php +++ b/apps/files_sharing/lib/capabilities.php @@ -24,28 +24,22 @@ class Capabilities { $res = array(); if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === "yes") { - $res["allow_links"] = 1; + $res["allow_links"] = true; if ($config->getAppValue('core', 'shareapi_enforce_links_password', 'yes') === "yes") { - $res["enforce_links_password"] = 1; - } else { - $res["enforce_links_password"] = 0; - } + $res["enforce_links_password"] = true; + } if ($config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === "yes") { - $res["allow_public_upload"] = 1; - } else { - $res["allow_public_upload"] = 0; + $res["allow_public_upload"] = true; } - } else { - $res["allow_links"] = 0; - } + + $res = array("sharing" => $res); + } return new \OC_OCS_Result(array( 'capabilities' => array( - 'files' => array( - 'sharing' => $res - ), + 'files' => $res ), )); } |