aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-05-24 13:26:03 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-05-24 13:26:03 +0200
commit89546bf90c5d567ed8b63c949f07ba312afa73a9 (patch)
treeaa4cc5b08e4df181d5132d3c13ef759633520303
parentc960cfcd556b0abc0e7a1690a49b8527bf401498 (diff)
downloadnextcloud-server-89546bf90c5d567ed8b63c949f07ba312afa73a9.tar.gz
nextcloud-server-89546bf90c5d567ed8b63c949f07ba312afa73a9.zip
add post hooks to share API, needed by the encryption app
-rw-r--r--lib/public/share.php30
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 7cebf654639..d98b2678d64 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1203,8 +1203,18 @@ class Share {
.' `file_target`, `token`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)');
// Share with a group
if ($shareType == self::SHARE_TYPE_GROUP) {
- $groupItemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith['group'],
- $uidOwner, $suggestedItemTarget);
+ $groupItemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith['group'], $uidOwner, $suggestedItemTarget);
+ \OC_Hook::emit('OCP\Share', 'pre_shared', array(
+ 'itemType' => $itemType,
+ 'itemSource' => $itemSource,
+ 'itemTarget' => $groupItemTarget,
+ 'shareType' => $shareType,
+ 'shareWith' => $shareWith['group'],
+ 'uidOwner' => $uidOwner,
+ 'permissions' => $permissions,
+ 'fileSource' => $fileSource,
+ 'token' => $token
+ ));
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {
@@ -1265,7 +1275,7 @@ class Share {
'itemTarget' => $groupItemTarget,
'parent' => $parent,
'shareType' => $shareType,
- 'shareWith' => $uid,
+ 'shareWith' => $shareWith['group'],
'uidOwner' => $uidOwner,
'permissions' => $permissions,
'fileSource' => $fileSource,
@@ -1278,8 +1288,18 @@ class Share {
return $parentFolders;
}
} else {
- $itemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
- $suggestedItemTarget);
+ $itemTarget = self::generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $suggestedItemTarget);
+ \OC_Hook::emit('OCP\Share', 'pre_shared', array(
+ 'itemType' => $itemType,
+ 'itemSource' => $itemSource,
+ 'itemTarget' => $itemTarget,
+ 'shareType' => $shareType,
+ 'shareWith' => $shareWith,
+ 'uidOwner' => $uidOwner,
+ 'permissions' => $permissions,
+ 'fileSource' => $fileSource,
+ 'token' => $token
+ ));
if (isset($fileSource)) {
if ($parentFolder) {
if ($parentFolder === true) {