$storage = new \ReflectionClass('\OC\Files\Storage\Shared');
$isInitialized = $storage->getProperty('isInitialized');
$isInitialized->setAccessible(true);
- $isInitialized->setValue(false);
+ $isInitialized->setValue(array());
$isInitialized->setAccessible(false);
}
*/
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();
foreach ($allFiles as $path) {
$usersSharing = $this->file->getAccessList($path);
- $encryptionModule->update($absPath, $this->uid, $usersSharing);
+ $encryptionModule->update($path, $this->uid, $usersSharing);
}
}
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);
}
}