summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2012-06-19 14:19:30 -0400
committerBart Visscher <bartv@thisnet.nl>2012-06-27 01:05:36 +0200
commit945565f4206367be53a2c612a2d078a6b539a343 (patch)
tree22a159d582e0bd122dcf8e55175199a71e93f320 /core/ajax
parentc7e0449a75ee2b19b46e40f6a0edcd1308c937e4 (diff)
downloadnextcloud-server-945565f4206367be53a2c612a2d078a6b539a343.tar.gz
nextcloud-server-945565f4206367be53a2c612a2d078a6b539a343.zip
Move ajax and js files to core
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/share.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php
new file mode 100644
index 00000000000..f87c12dbb59
--- /dev/null
+++ b/core/ajax/share.php
@@ -0,0 +1,42 @@
+<?php
+/**
+* ownCloud
+*
+* @author Michael Gapczynski
+* @copyright 2012 Michael Gapczynski mtgap@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\JSON::checkLoggedIn();
+switch ($_POST['action']) {
+ case 'share':
+ $return = OCP\Share::share($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']);
+ ($return) ? OCP\JSON::success() : OCP\JSON::error();
+ break;
+ case 'unshare':
+ $return = OCP\Share::unshare($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith']);
+ ($return) ? OCP\JSON::success() : OCP\JSON::error();
+ break;
+ case 'setTarget':
+ $return = OCP\Share::setTarget($_POST['itemType'], $_POST['item'], $_POST['newTarget']);
+ ($return) ? OCP\JSON::success() : OCP\JSON::error();
+ break;
+ case 'setPermissions':
+ $return = OCP\Share::setPermissions($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']);
+ ($return) ? OCP\JSON::success() : OCP\JSON::error();
+ break;
+}
+
+?> \ No newline at end of file