fix share for renamed or moved files
This commit is contained in:
parent
8ee7959092
commit
d017bbb065
|
@ -343,13 +343,13 @@ class Proxy extends \OC_FileProxy {
|
||||||
\OC_FileProxy::$enabled = false;
|
\OC_FileProxy::$enabled = false;
|
||||||
|
|
||||||
$view = new \OC_FilesystemView('/');
|
$view = new \OC_FilesystemView('/');
|
||||||
|
$session = new Session($view);
|
||||||
$userId = \OCP\User::getUser();
|
$userId = \OCP\User::getUser();
|
||||||
$util = new Util( $view, $userId );
|
$util = new Util( $view, $userId );
|
||||||
|
|
||||||
// Reformat path for use with OC_FSV
|
// Reformat path for use with OC_FSV
|
||||||
$newPathSplit = explode( '/', $newPath );
|
$newPathSplit = explode( '/', $newPath );
|
||||||
$newPathRelative = implode( '/', array_slice( $newPathSplit, 3 ) );
|
$newPathRelative = implode( '/', array_slice( $newPathSplit, 3 ) );
|
||||||
$newPathRelativeToUser = implode( '/', array_slice( $newPathSplit, 2 ) );
|
|
||||||
|
|
||||||
// get file info from database/cache
|
// get file info from database/cache
|
||||||
//$newFileInfo = \OC\Files\Filesystem::getFileInfo($newPathRelative);
|
//$newFileInfo = \OC\Files\Filesystem::getFileInfo($newPathRelative);
|
||||||
|
@ -386,8 +386,19 @@ class Proxy extends \OC_FileProxy {
|
||||||
|
|
||||||
$view->putFileInfo( $newPath, $cached );
|
$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;
|
\OC_FileProxy::$enabled = $proxyStatus;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue