[Pkg-owncloud-commits] [owncloud] 02/34: Only return capabilities if they are set

David Prévot taffit at moszumanska.debian.org
Wed Mar 11 15:49:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v8.0.0
in repository owncloud.

commit ea1f726b7defe1161e22c3d2972d85fbb530d182
Author: Roeland Jago Douma <roeland at famdouma.nl>
Date:   Mon Jan 26 16:14:05 2015 +0100

    Only return capabilities if they are set
---
 apps/files_sharing/lib/capabilities.php | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php
index 712eb23..25b0484 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
 				),
 			));
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list