fix re-shares with encryption
This commit is contained in:
parent
60d8a39f03
commit
fac7ec3fc4
|
@ -157,7 +157,7 @@ abstract class TestCase extends \Test\TestCase {
|
||||||
$storage = new \ReflectionClass('\OC\Files\Storage\Shared');
|
$storage = new \ReflectionClass('\OC\Files\Storage\Shared');
|
||||||
$isInitialized = $storage->getProperty('isInitialized');
|
$isInitialized = $storage->getProperty('isInitialized');
|
||||||
$isInitialized->setAccessible(true);
|
$isInitialized->setAccessible(true);
|
||||||
$isInitialized->setValue(false);
|
$isInitialized->setValue(array());
|
||||||
$isInitialized->setAccessible(false);
|
$isInitialized->setAccessible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,11 @@ class Update {
|
||||||
*/
|
*/
|
||||||
private function update($fileSource) {
|
private function update($fileSource) {
|
||||||
$path = \OC\Files\Filesystem::getPath($fileSource);
|
$path = \OC\Files\Filesystem::getPath($fileSource);
|
||||||
$absPath = '/' . $this->uid . '/files' . $path;
|
$info = \OC\Files\Filesystem::getFileInfo($path);
|
||||||
|
$owner = \OC\Files\Filesystem::getOwner($path);
|
||||||
|
$view = new \OC\Files\View('/' . $owner . '/files');
|
||||||
|
$ownerPath = $view->getPath($info->getId());
|
||||||
|
$absPath = '/' . $owner . '/files' . $ownerPath;
|
||||||
|
|
||||||
$mount = $this->mountManager->find($path);
|
$mount = $this->mountManager->find($path);
|
||||||
$mountPoint = $mount->getMountPoint();
|
$mountPoint = $mount->getMountPoint();
|
||||||
|
@ -110,7 +114,7 @@ class Update {
|
||||||
|
|
||||||
foreach ($allFiles as $path) {
|
foreach ($allFiles as $path) {
|
||||||
$usersSharing = $this->file->getAccessList($path);
|
$usersSharing = $this->file->getAccessList($path);
|
||||||
$encryptionModule->update($absPath, $this->uid, $usersSharing);
|
$encryptionModule->update($path, $this->uid, $usersSharing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,11 +180,11 @@ class Util {
|
||||||
foreach ($content as $c) {
|
foreach ($content as $c) {
|
||||||
// getDirectoryContent() returns the paths relative to the mount points, so we need
|
// getDirectoryContent() returns the paths relative to the mount points, so we need
|
||||||
// to re-construct the complete path
|
// to re-construct the complete path
|
||||||
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c['path'] : $c['path'];
|
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c->getPath() : $c->getPath();
|
||||||
if ($c['type'] === 'dir') {
|
if ($c['type'] === 'dir') {
|
||||||
$dirList[] = $path;
|
$dirList[] = \OC\Files\Filesystem::normalizePath($path);
|
||||||
} else {
|
} else {
|
||||||
$result[] = $path;
|
$result[] = \OC\Files\Filesystem::normalizePath($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue