fix re-shares with encryption

remotes/origin/poc-doctrine-migrations
Bjoern Schiessle 11 years ago committed by Thomas Müller
parent 60d8a39f03
commit fac7ec3fc4
  1. 2
      apps/files_sharing/tests/testcase.php
  2. 8
      lib/private/encryption/update.php
  3. 6
      lib/private/encryption/util.php

@ -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);
}

@ -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);
}
}

@ -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);
}
}

Loading…
Cancel
Save