}\r
\r
// if we unshare a folder we need a list of all (sub-)files\r
- if ($params['itemType'] === 'folder') {\r
+ if ( $params['itemType'] === 'folder' ) {\r
\r
- $allFiles = $util->getAllFiles($path);\r
+ // get the path including mount point only if not a shared folder\r
+ if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {\r
+ // get path including the the storage mount point\r
+ $path = $util->getPathWithMountPoint($params['itemSource']);\r
+ }\r
\r
+ $allFiles = $util->getAllFiles( $path );\r
+ \r
} else {\r
- \r
- $allFiles = array( $path );\r
+ \r
+ $allFiles = array($path);\r
}\r
\r
- foreach ( $allFiles as $path ) {\r
+ foreach ($allFiles as $path) {\r
\r
// check if the user still has access to the file, otherwise delete share key\r
- $sharingUsers = $util->getSharingUsersArray( true, $path );\r
+ $sharingUsers = $util->getSharingUsersArray(true, $path);\r
\r
// Unshare every user who no longer has access to the file\r
- $delUsers = array_diff( $userIds, $sharingUsers);\r
+ $delUsers = array_diff($userIds, $sharingUsers);\r
\r
// delete share key\r
- Keymanager::delShareKey( $view, $delUsers, $path );\r
+ Keymanager::delShareKey($view, $delUsers, $path);\r
}\r
\r
}\r