summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-11 00:25:32 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-11 00:25:32 +0200
commit33e0dfeecbcfba7c3caa6765f156cd06d7dfdb13 (patch)
tree771290c052cded1c458d3c46ff5f52ba37af4f42 /apps/files_encryption/hooks
parente88595638c787e04d1cd6c2df2aabf82ba4729d1 (diff)
downloadnextcloud-server-33e0dfeecbcfba7c3caa6765f156cd06d7dfdb13.tar.gz
nextcloud-server-33e0dfeecbcfba7c3caa6765f156cd06d7dfdb13.zip
sharing with group should work now
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index e8cd4ade713..619a4d1bfee 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -292,10 +292,16 @@ class Hooks {
foreach ( $allFiles as $path ) {
$usersSharing = $util->getSharingUsersArray( $sharingEnabled, $path );
-
- // Because this is a pre_share hook, the user
- // being shared to is not yet included; add them
- $usersSharing[] = $params['shareWith'];
+
+ // check if we share to a group
+ if($params['shareType'] === \OCP\Share::SHARE_TYPE_GROUP) {
+ $usersSharing[] = reset(\OC_Group::usersInGroup($params['shareWith']));
+ } else {
+ // Because this is a pre_share hook, the user
+ // being shared to is not yet included; add them
+ $usersSharing[] = $params['shareWith'];
+ }
+
// Attempt to set shareKey
if ( ! $util->setSharedFileKeyfiles( $session, $usersSharing, $path ) ) {
@@ -310,8 +316,7 @@ class Hooks {
// Set flag var 'run' to notify emitting
// script that hook execution failed
$params['run']->run = false;
-
- // TODO: Make sure files_sharing provides user
+ // TODO: Make sure files_sharing provides user
// feedback on failed share
}