From: Florin Peter Date: Thu, 25 Apr 2013 21:24:07 +0000 (+0200) Subject: fix share for renamed or moved files X-Git-Tag: v6.0.0alpha2~743^2~155 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d017bbb065245212e8aa4091f4bee0a4e8ea9055;p=nextcloud-server.git fix share for renamed or moved files --- diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 7294c243664..73f72a9e23e 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -343,13 +343,13 @@ class Proxy extends \OC_FileProxy { \OC_FileProxy::$enabled = false; $view = new \OC_FilesystemView('/'); + $session = new Session($view); $userId = \OCP\User::getUser(); $util = new Util( $view, $userId ); // Reformat path for use with OC_FSV $newPathSplit = explode( '/', $newPath ); $newPathRelative = implode( '/', array_slice( $newPathSplit, 3 ) ); - $newPathRelativeToUser = implode( '/', array_slice( $newPathSplit, 2 ) ); // get file info from database/cache //$newFileInfo = \OC\Files\Filesystem::getFileInfo($newPathRelative); @@ -386,8 +386,19 @@ class Proxy extends \OC_FileProxy { $view->putFileInfo( $newPath, $cached ); + // get sharing app state + $sharingEnabled = \OCP\Share::isEnabled(); + + // get users + $usersSharing = $util->getSharingUsersArray($sharingEnabled, $newPathRelative); + + // update sharing-keys + $util->setSharedFileKeyfiles($session, $usersSharing, $newPathRelative); } + + + \OC_FileProxy::$enabled = $proxyStatus; return true;