Skip to content
Snippets Groups Projects
Commit e743386a authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Fix correctFolders and retrieve the correct storage cache

parent 02e2f738
No related branches found
No related tags found
No related merge requests found
...@@ -42,10 +42,12 @@ class Shared_Cache extends Cache { ...@@ -42,10 +42,12 @@ class Shared_Cache extends Cache {
*/ */
private function getSourceCache($target) { private function getSourceCache($target) {
$source = \OC_Share_Backend_File::getSource($target); $source = \OC_Share_Backend_File::getSource($target);
if (isset($source['path'])) { if (isset($source['path']) && isset($source['fileOwner'])) {
$source['path'] = '/' . $source['uid_owner'] . '/' . $source['path']; \OC\Files\Filesystem::initMountPoints($source['fileOwner']);
\OC\Files\Filesystem::initMountPoints($source['uid_owner']); $mount = \OC\Files\Mount::findByNumericId($source['storage']);
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source['path']); if ($mount) {
$fullPath = $mount->getMountPoint().$source['path'];
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($fullPath);
if ($storage) { if ($storage) {
$this->files[$target] = $internalPath; $this->files[$target] = $internalPath;
$cache = $storage->getCache(); $cache = $storage->getCache();
...@@ -54,6 +56,7 @@ class Shared_Cache extends Cache { ...@@ -54,6 +56,7 @@ class Shared_Cache extends Cache {
return $cache; return $cache;
} }
} }
}
return false; return false;
} }
......
...@@ -38,14 +38,11 @@ class Shared_Updater { ...@@ -38,14 +38,11 @@ class Shared_Updater {
while (!empty($users)) { while (!empty($users)) {
$reshareUsers = array(); $reshareUsers = array();
foreach ($users as $user) { foreach ($users as $user) {
// The ETag of the logged in user should already be updated
if ($user !== $uid) {
$etag = \OC\Files\Filesystem::getETag(''); $etag = \OC\Files\Filesystem::getETag('');
\OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag); \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
// Look for reshares // Look for reshares
$reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true)); $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
} }
}
$users = $reshareUsers; $users = $reshareUsers;
} }
// Correct folders of shared file owner // Correct folders of shared file owner
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment