aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2013-03-09 16:59:13 -0800
committerTom Needham <needham.thomas@gmail.com>2013-03-09 16:59:13 -0800
commitdfbf57207d2d47a843b514728b7254e76930b20c (patch)
treee1c2037a39247d5e170dac90d2ce8d708ef13441 /apps/files_encryption
parent6bdb84ab288a2ef2087c8daa2255071cf45d26b4 (diff)
parente58dbd46fc4648ca6f33b83e7ce7745f07217477 (diff)
downloadnextcloud-server-dfbf57207d2d47a843b514728b7254e76930b20c.tar.gz
nextcloud-server-dfbf57207d2d47a843b514728b7254e76930b20c.zip
Merge pull request #1584 from owncloud/ocs_multiple_methods
Allow registering of multiple methods on each api route. Add /cloud/capabilities route.
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/appinfo/app.php1
-rw-r--r--apps/files_encryption/appinfo/routes.php9
-rw-r--r--apps/files_encryption/lib/capabilities.php23
3 files changed, 33 insertions, 0 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index f7b2140b580..bf16fec3aea 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -7,6 +7,7 @@ OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'files_encryption/lib/keymanager.p
OC::$CLASSPATH['OCA\Encryption\Stream'] = 'files_encryption/lib/stream.php';
OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'files_encryption/lib/proxy.php';
OC::$CLASSPATH['OCA\Encryption\Session'] = 'files_encryption/lib/session.php';
+OC::$CLASSPATH['OCA\Encryption\Capabilities'] = 'files_encryption/lib/capabilities.php';
OC_FileProxy::register( new OCA\Encryption\Proxy() );
diff --git a/apps/files_encryption/appinfo/routes.php b/apps/files_encryption/appinfo/routes.php
new file mode 100644
index 00000000000..ab83432a4b2
--- /dev/null
+++ b/apps/files_encryption/appinfo/routes.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013, Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+// Register with the capabilities API
+OC_API::register('get', '/cloud/capabilities', array('OCA\Encryption\Capabilities', 'getCapabilities'), 'files_encryption', OC_API::USER_AUTH); \ No newline at end of file
diff --git a/apps/files_encryption/lib/capabilities.php b/apps/files_encryption/lib/capabilities.php
new file mode 100644
index 00000000000..72baddcd049
--- /dev/null
+++ b/apps/files_encryption/lib/capabilities.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2013 Tom Needham <tom@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCA\Encryption;
+
+class Capabilities {
+
+ public static function getCapabilities() {
+ return new \OC_OCS_Result(array(
+ 'capabilities' => array(
+ 'files' => array(
+ 'encryption' => true,
+ ),
+ ),
+ ));
+ }
+
+} \ No newline at end of file