summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/appinfo
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-10-28 11:06:47 +0000
committerTom Needham <needham.thomas@gmail.com>2012-10-28 11:06:47 +0000
commitb07944798848bc5196dc75e8d8caea5ca71b0f15 (patch)
tree36f9d1f314c209a5261348f9c4e2ca2ad25be0e0 /apps/files_sharing/appinfo
parent07111ff672037282a6ca870fc19eab9f36875ea0 (diff)
downloadnextcloud-server-b07944798848bc5196dc75e8d8caea5ca71b0f15.tar.gz
nextcloud-server-b07944798848bc5196dc75e8d8caea5ca71b0f15.zip
Add API method for sharing a file, currently only via a link.
Diffstat (limited to 'apps/files_sharing/appinfo')
-rw-r--r--apps/files_sharing/appinfo/app.php3
-rw-r--r--apps/files_sharing/appinfo/routes.php24
2 files changed, 26 insertions, 1 deletions
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index 109f86b2e87..1402a146454 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -3,7 +3,8 @@
OC::$CLASSPATH['OC_Share_Backend_File'] = "apps/files_sharing/lib/share/file.php";
OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'apps/files_sharing/lib/share/folder.php';
OC::$CLASSPATH['OC_Filestorage_Shared'] = "apps/files_sharing/lib/sharedstorage.php";
+OC::$CLASSPATH['OC_Sharing_API'] = "apps/files_sharing/lib/api.php";
OCP\Util::connectHook('OC_Filesystem', 'setup', 'OC_Filestorage_Shared', 'setup');
OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
-OCP\Util::addScript('files_sharing', 'share');
+OCP\Util::addScript('files_sharing', 'share'); \ No newline at end of file
diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php
new file mode 100644
index 00000000000..d10607aa600
--- /dev/null
+++ b/apps/files_sharing/appinfo/routes.php
@@ -0,0 +1,24 @@
+<?php
+/**
+* ownCloud
+*
+* @author Tom Needham
+* @copyright 2012 Tom Needham tom@owncloud.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+OCP\API::register('post', '/cloud/files/share/{type}/{path}', array('OC_Sharing_API', 'shareFile'), 'files_sharing', OC_API::USER_AUTH, array(), array('type' => 'user|group|link|email|contact|remote', 'path' => '.*'));
+
+?> \ No newline at end of file