summaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 7d806fafd04..9aacf5e3449 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -342,6 +342,13 @@ class Share {
*/
public static function unshare($itemType, $itemSource, $shareType, $shareWith) {
if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), self::FORMAT_NONE, null, 1)) {
+ // 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;
}
@@ -356,6 +363,12 @@ class Share {
*/
public static function unshareAll($itemType, $itemSource) {
if ($shares = self::getItemShared($itemType, $itemSource)) {
+ // 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']);
}
@@ -764,8 +777,8 @@ class Share {
if ( isset($row['share_with']) && $row['share_with'] != '') {
$row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']);
}
- if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
- $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);
+ if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
+ $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);
}
$items[$row['id']] = $row;