]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added two hooks: pre_unshare and pre_unshareAll, useful for files_encryption
authorSam Tuke <samtuke@owncloud.com>
Mon, 14 Jan 2013 17:05:47 +0000 (17:05 +0000)
committerSam Tuke <samtuke@owncloud.com>
Mon, 14 Jan 2013 17:05:47 +0000 (17:05 +0000)
lib/public/share.php

index 8c0cfc16b4eb3d77d49fba6e7c505fc134635a63..0ff68fe265a5a3fc5c3d7b8c449444458fc8dbbf 100644 (file)
@@ -465,6 +465,13 @@ class Share {
                                                           null,
                                                           1);
                if ($item) {
+                       // Pass all the vars we have for now, they may be useful
+                       \OC_Hook::emit('OCP\Share', 'pre_unshare', array(
+                               'itemType' => $itemType,
+                               'itemSource' => $itemSource,
+                               'shareType' => $shareType,
+                               'shareWith' => $shareWith,
+                       ));
                        self::delete($item['id']);
                        return true;
                }
@@ -480,6 +487,12 @@ class Share {
        public static function unshareAll($itemType, $itemSource) {
                $shares = self::getItemShared($itemType, $itemSource);
                if ($shares) {
+                       // Pass all the vars we have for now, they may be useful
+                       \OC_Hook::emit('OCP\Share', 'pre_unshareAll', array(
+                               'itemType' => $itemType,
+                               'itemSource' => $itemSource,
+                               'shares' => $shares
+                       ));
                        foreach ($shares as $share) {
                                self::delete($share['id']);
                        }