aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-04 14:32:05 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-04 14:32:05 +0200
commit985758305f66d80f2b0625423b0bee68fce2a2d9 (patch)
treeb311e24cf936c2310a248f7e759c66ece2a3cd75
parent85758f3d7d7aed9cca5b043f85cdac216e4891b9 (diff)
downloadnextcloud-server-985758305f66d80f2b0625423b0bee68fce2a2d9.tar.gz
nextcloud-server-985758305f66d80f2b0625423b0bee68fce2a2d9.zip
initial commit, start implementing the ocs share api
-rw-r--r--apps/files_sharing/appinfo/app.php1
-rw-r--r--apps/files_sharing/appinfo/routes.php53
2 files changed, 53 insertions, 1 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 895d446a336..ffdcbf05109 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -7,6 +7,7 @@ OC::$CLASSPATH['OC\Files\Cache\Shared_Cache'] = 'files_sharing/lib/cache.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
+OC::$CLASSPATH['OCA\Files\Share\Api'] = 'files_sharing/lib/api.php';
OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php
index 02815b5eb42..15af5226e18 100644
--- a/apps/files_sharing/appinfo/routes.php
+++ b/apps/files_sharing/appinfo/routes.php
@@ -2,4 +2,55 @@
$this->create('core_ajax_public_preview', '/publicpreview.png')->action(
function() {
require_once __DIR__ . '/../ajax/publicpreview.php';
-}); \ No newline at end of file
+});
+
+//TODO: GET: share status of a given file/folder
+//TODO: GET: share status of all files in a given folder?
+//TODO: SET: share (unshare)
+//TODO: SET: permissions
+//TODO: SET: expire date
+//TODO: SET: mail notification
+
+OC_API::register('get',
+ '/apps/files_sharing/api/share/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''),
+ array('path' => '.+')); //allow slashes in parameter path
+/*
+OC_API::register('get',
+ '/apps/files_sharing/api/share/group/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''));
+
+OC_API::register('get',
+ '/apps/files_sharing/api/share/user/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''));
+
+OC_API::register('get',
+ '/apps/files_sharing/api/permission/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''));
+
+OC_API::register('get',
+ '/apps/files_sharing/api/expire/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''));
+
+OC_API::register('get',
+ '/apps/files_sharing/api/notify/{path}',
+ array('\OCA\Files\Share\Api', 'getShare'),
+ 'files_sharing',
+ OC_API::USER_AUTH,
+ array('path' => ''));
+*/