sharing with group should work now
This commit is contained in:
parent
e88595638c
commit
33e0dfeecb
|
@ -292,10 +292,16 @@ class Hooks {
|
||||||
foreach ( $allFiles as $path ) {
|
foreach ( $allFiles as $path ) {
|
||||||
|
|
||||||
$usersSharing = $util->getSharingUsersArray( $sharingEnabled, $path );
|
$usersSharing = $util->getSharingUsersArray( $sharingEnabled, $path );
|
||||||
|
|
||||||
// Because this is a pre_share hook, the user
|
// check if we share to a group
|
||||||
// being shared to is not yet included; add them
|
if($params['shareType'] === \OCP\Share::SHARE_TYPE_GROUP) {
|
||||||
$usersSharing[] = $params['shareWith'];
|
$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
|
// Attempt to set shareKey
|
||||||
if ( ! $util->setSharedFileKeyfiles( $session, $usersSharing, $path ) ) {
|
if ( ! $util->setSharedFileKeyfiles( $session, $usersSharing, $path ) ) {
|
||||||
|
@ -310,8 +316,7 @@ class Hooks {
|
||||||
// Set flag var 'run' to notify emitting
|
// Set flag var 'run' to notify emitting
|
||||||
// script that hook execution failed
|
// script that hook execution failed
|
||||||
$params['run']->run = false;
|
$params['run']->run = false;
|
||||||
|
// TODO: Make sure files_sharing provides user
|
||||||
// TODO: Make sure files_sharing provides user
|
|
||||||
// feedback on failed share
|
// feedback on failed share
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue