From: Florin Peter Date: Wed, 29 May 2013 22:45:29 +0000 (+0200) Subject: Merge branch 'master' into file_encryption_external_storage_fixes X-Git-Tag: v6.0.0alpha2~705^2~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=313631edf6aac23a68ab70bd3c0d6f0d6b59b894;p=nextcloud-server.git Merge branch 'master' into file_encryption_external_storage_fixes Conflicts: apps/files_encryption/hooks/hooks.php --- 313631edf6aac23a68ab70bd3c0d6f0d6b59b894 diff --cc apps/files_encryption/hooks/hooks.php index dd51a75f8f8,955425595ba..9893cecc94e --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@@ -408,31 -405,25 +412,31 @@@ class Hooks } // if we unshare a folder we need a list of all (sub-)files - if ($params['itemType'] === 'folder') { + if ( $params['itemType'] === 'folder' ) { - $allFiles = $util->getAllFiles($path); + // get the path including mount point only if not a shared folder + if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) { + // get path including the the storage mount point + $path = $util->getPathWithMountPoint($params['itemSource']); + } + $allFiles = $util->getAllFiles( $path ); + } else { - - $allFiles = array( $path ); + + $allFiles = array($path); } - foreach ( $allFiles as $path ) { + foreach ($allFiles as $path) { // check if the user still has access to the file, otherwise delete share key - $sharingUsers = $util->getSharingUsersArray( true, $path ); + $sharingUsers = $util->getSharingUsersArray(true, $path); // Unshare every user who no longer has access to the file - $delUsers = array_diff( $userIds, $sharingUsers); + $delUsers = array_diff($userIds, $sharingUsers); // delete share key - Keymanager::delShareKey( $view, $delUsers, $path ); + Keymanager::delShareKey($view, $delUsers, $path); } }