fix re-shares with encryption

This commit is contained in:
Bjoern Schiessle 2015-04-02 12:03:37 +02:00 committed by Thomas Müller
parent 60d8a39f03
commit fac7ec3fc4
3 changed files with 10 additions and 6 deletions

View File

@ -157,7 +157,7 @@ abstract class TestCase extends \Test\TestCase {
$storage = new \ReflectionClass('\OC\Files\Storage\Shared');
$isInitialized = $storage->getProperty('isInitialized');
$isInitialized->setAccessible(true);
$isInitialized->setValue(false);
$isInitialized->setValue(array());
$isInitialized->setAccessible(false);
}

View File

@ -94,7 +94,11 @@ class Update {
*/
private function update($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);
$mountPoint = $mount->getMountPoint();
@ -110,7 +114,7 @@ class Update {
foreach ($allFiles as $path) {
$usersSharing = $this->file->getAccessList($path);
$encryptionModule->update($absPath, $this->uid, $usersSharing);
$encryptionModule->update($path, $this->uid, $usersSharing);
}
}

View File

@ -180,11 +180,11 @@ class Util {
foreach ($content as $c) {
// getDirectoryContent() returns the paths relative to the mount points, so we need
// to re-construct the complete path
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c['path'] : $c['path'];
$path = ($mountPoint !== '') ? $mountPoint . '/' . $c->getPath() : $c->getPath();
if ($c['type'] === 'dir') {
$dirList[] = $path;
$dirList[] = \OC\Files\Filesystem::normalizePath($path);
} else {
$result[] = $path;
$result[] = \OC\Files\Filesystem::normalizePath($path);
}
}