summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-01-26 16:14:05 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2015-02-04 14:56:31 +0100
commitea1f726b7defe1161e22c3d2972d85fbb530d182 (patch)
tree2a43bd4b8b081ea41f162811c9236f7731aad4eb /apps/files_sharing
parentb3ea849a8704d29fad0a738af8af3430ebb5b3af (diff)
downloadnextcloud-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.php22
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
),
));
}