summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2013-02-09 12:50:19 +0000
committerTom Needham <tom@owncloud.com>2013-02-09 12:50:19 +0000
commit5ad1b63f762ab52f8bf550787588dd1ca728145d (patch)
tree19dc892f79f3277a3addda58f15d21e72630bf85
parent5d14a2cc463f09d010537a5537e3339a87d57558 (diff)
downloadnextcloud-server-5ad1b63f762ab52f8bf550787588dd1ca728145d.tar.gz
nextcloud-server-5ad1b63f762ab52f8bf550787588dd1ca728145d.zip
Fix api result merging.
-rw-r--r--apps/files_versions/appinfo/app.php3
-rw-r--r--apps/files_versions/appinfo/routes.php2
-rw-r--r--apps/files_versions/lib/capabilities.php6
-rw-r--r--lib/api.php6
-rw-r--r--ocs/routes.php2
5 files changed, 10 insertions, 9 deletions
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index d45c0c99a73..8de5dc27ca5 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -3,8 +3,7 @@
//require_once 'files_versions/versions.php';
OC::$CLASSPATH['OCA\Files_Versions\Storage'] = 'apps/files_versions/lib/versions.php';
OC::$CLASSPATH['OCA\Files_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php';
-OC::$CLASSPATH['OCA\Files_Versions\Capabiltiies'] = 'apps/files_versions/lib/capabilities.php';
-
+OC::$CLASSPATH['OCA\Files_Versions\Capabilities'] = 'apps/files_versions/lib/capabilities.php';
OCP\App::registerAdmin('files_versions', 'settings');
OCP\App::registerPersonal('files_versions', 'settings-personal');
diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php
index 125b96db175..3793e25173e 100644
--- a/apps/files_versions/appinfo/routes.php
+++ b/apps/files_versions/appinfo/routes.php
@@ -6,4 +6,4 @@
*/
// Register with the capabilities API
-OC_API::register('get', '/cloud/capabilities', array('OC_Files_Versions_Capabiltiies', 'getCapabilities'), 'ocs', OC_API::USER_AUTH); \ No newline at end of file
+OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'ocs', OC_API::USER_AUTH); \ No newline at end of file
diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php
index ac70773df06..1592c2b06e9 100644
--- a/apps/files_versions/lib/capabilities.php
+++ b/apps/files_versions/lib/capabilities.php
@@ -6,10 +6,12 @@
* See the COPYING-README file.
*/
-class OC_Files_Versions_Capabilities {
+namespace OCA\Files_Versions;
+
+class Capabilities {
public static function getCapabilities() {
- return OC_OCS_Result(array(
+ return new \OC_OCS_Result(array(
'capabilities' => array(
'files_versions' => array(
'versioning' => true,
diff --git a/lib/api.php b/lib/api.php
index 3d160734fb7..d50882b1190 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -118,7 +118,6 @@ class OC_API {
);
}
-
$response = self::mergeResponses($responses);
$formats = array('json', 'xml');
$format = !empty($_GET['format']) && in_array($_GET['format'], $formats) ? $_GET['format'] : 'xml';
@@ -134,7 +133,7 @@ class OC_API {
$response = array();
// Sort into shipped and thirdparty
$shipped = array(
- 'succeded' => array(),
+ 'succeeded' => array(),
'failed' => array(),
);
$thirdparty = array(
@@ -143,7 +142,7 @@ class OC_API {
);
foreach($responses as $response) {
- if(OC_App::isShipped($response['app'])) {
+ if(OC_App::isShipped($response['app']) || ($response['app'] === 'core')) {
if($response['response']->succeeded()) {
$shipped['succeeded'][$response['app']] = $response['response'];
} else {
@@ -250,6 +249,7 @@ class OC_API {
*/
private static function respond($result, $format='xml') {
// Send 401 headers if unauthorised
+ die(var_dump($result));
if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) {
header('WWW-Authenticate: Basic realm="Authorisation Required"');
header('HTTP/1.0 401 Unauthorized');
diff --git a/ocs/routes.php b/ocs/routes.php
index 5e4758fb705..81beae2f881 100644
--- a/ocs/routes.php
+++ b/ocs/routes.php
@@ -18,4 +18,4 @@ OC_API::register('get', '/privatedata/getattribute/{app}/{key}', array('OC_OCS_P
OC_API::register('post', '/privatedata/setattribute/{app}/{key}', array('OC_OCS_Privatedata', 'set'), 'ocs', OC_API::USER_AUTH);
OC_API::register('post', '/privatedata/deleteattribute/{app}/{key}', array('OC_OCS_Privatedata', 'delete'), 'ocs', OC_API::USER_AUTH);
// cloud
-OC_API::register('get', '/cloud/capabilities', array('OC_OCS_Cloud', 'getCapabilities'), 'ocs', OC_API::USER_AUTH); \ No newline at end of file
+OC_API::register('get', '/cloud/capabilities', array('OC_OCS_Cloud', 'getCapabilities'), 'core', OC_API::USER_AUTH); \ No newline at end of file