]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed user/group sharing hooks
authorFlorian Hülsmann <fh@cbix.de>
Fri, 26 Oct 2012 21:06:40 +0000 (23:06 +0200)
committerFlorian Hülsmann <fh@cbix.de>
Fri, 26 Oct 2012 21:15:37 +0000 (23:15 +0200)
lib/public/share.php

index 7a9a087d1bd75fcc7479a0b1e7e8d6b80f2d8118..da1c0616390720527348d67b9ea2c6724311236c 100644 (file)
@@ -937,23 +937,23 @@ class Share {
                                } else {
                                        $fileTarget = null;
                                }
+                               \OC_Hook::emit('OCP\Share', 'post_shared', array(
+                                       'itemType' => $itemType,
+                                       'itemSource' => $itemSource,
+                                       'itemTarget' => $itemTarget,
+                                       'parent' => $parent,
+                                       'shareType' => self::$shareTypeGroupUserUnique,
+                                       'shareWith' => $uid,
+                                       'uidOwner' => $uidOwner,
+                                       'permissions' => $permissions,
+                                       'fileSource' => $fileSource,
+                                       'fileTarget' => $fileTarget,
+                                       'id' => $parent
+                               ));
                                // Insert an extra row for the group share if the item or file target is unique for this user
                                if ($itemTarget != $groupItemTarget || (isset($fileSource) && $fileTarget != $groupFileTarget)) {
                                        $query->execute(array($itemType, $itemSource, $itemTarget, $parent, self::$shareTypeGroupUserUnique, $uid, $uidOwner, $permissions, time(), $fileSource, $fileTarget));
                                        $id = \OC_DB::insertid('*PREFIX*share');
-                                       \OC_Hook::emit('OCP\Share', 'post_shared', array(
-                                               'itemType' => $itemType,
-                                               'itemSource' => $itemSource,
-                                               'itemTarget' => $itemTarget,
-                                               'parent' => $parent,
-                                               'shareType' => self::$shareTypeGroupUserUnique,
-                                               'shareWith' => $uid,
-                                               'uidOwner' => $uidOwner,
-                                               'permissions' => $permissions,
-                                               'fileSource' => $fileSource,
-                                               'fileTarget' => $fileTarget,
-                                               'id' => $id
-                                       ));
                                }
                        }
                        if ($parentFolder === true) {