$util = new Util( $view, $userId );\r
$path = $util->fileIdToPath( $params['itemSource'] );\r
\r
+ // If path is a folder, get all children\r
$allPaths = $util->getPaths( $path );\r
\r
foreach ( $allPaths as $path ) {\r
\r
- if ( ! Keymanager::delShareKey( $view, $userId, $path ) ) {\r
+ // Unshare each child path\r
+ if ( ! Keymanager::delShareKey( $view, $params['shareWith'], $path ) ) {\r
\r
$failed[] = $path;\r
\r
*/\r
public static function delShareKey( \OC_FilesystemView $view, $userId, $filePath ) {\r
\r
+ \OC_FileProxy::$enabled = false;\r
+ \r
$trimmed = ltrim( $filePath, '/' );\r
$shareKeyPath = '/' . $userId . '/files_encryption/share-keys/' . $trimmed . '.shareKey';\r
\r
// true), so we perform our own test\r
if ( $view->file_exists( $shareKeyPath ) ) {\r
\r
- return $view->unlink( $shareKeyPath );\r
+ $result = $view->unlink( $shareKeyPath );\r
\r
} else {\r
\r
+ trigger_error("Could not delete shareKey; does not exist: $shareKeyPath");\r
+ \r
\OC_Log::write( 'Encryption library', 'Could not delete shareKey; does not exist: "' . $shareKeyPath, \OC_Log::ERROR );\r
\r
- return false;\r
+ $result = false;\r
\r
}\r
\r
+ \OC_FileProxy::$enabled = false;\r
+ \r
+ return $result;\r
+ \r
}\r
\r
/**\r