summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-06-01 15:05:04 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-07-03 09:30:49 +0200
commit2118713477207b28d2d2b3abb95467c61fac69ec (patch)
treea114f7d45e4bc006570075a3c95ca3c1b6b329fc /apps/files_sharing/lib
parentdf303b910a3f4f7e836f9ab7630426a25456e77a (diff)
downloadnextcloud-server-2118713477207b28d2d2b3abb95467c61fac69ec.tar.gz
nextcloud-server-2118713477207b28d2d2b3abb95467c61fac69ec.zip
Add OCS api to get, accept and decline remote shares
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/external/manager.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php
index 0246e2d9c80..67a26c096c2 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -186,6 +186,7 @@ class Manager {
* accept server-to-server share
*
* @param int $id
+ * @return bool True if the share could be accepted, false otherwise
*/
public function acceptShare($id) {
@@ -204,13 +205,18 @@ class Manager {
WHERE `id` = ? AND `user` = ?');
$acceptShare->execute(array(1, $mountPoint, $hash, $id, $this->uid));
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'accept');
+
+ return true;
}
+
+ return false;
}
/**
* decline server-to-server share
*
* @param int $id
+ * @return bool True if the share could be declined, false otherwise
*/
public function declineShare($id) {
@@ -221,7 +227,11 @@ class Manager {
DELETE FROM `*PREFIX*share_external` WHERE `id` = ? AND `user` = ?');
$removeShare->execute(array($id, $this->uid));
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
+
+ return true;
}
+
+ return false;
}
/**