]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix re-shares with encryption
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 2 Apr 2015 10:03:37 +0000 (12:03 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:30 +0000 (13:30 +0200)
apps/files_sharing/tests/testcase.php
lib/private/encryption/update.php
lib/private/encryption/util.php

index 69f68f7dfe8694e2124edf45373c872cf5ec84b7..b9f8658a69ecd9a90a1c41f01f006924782e1755 100644 (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);
        }
 
index e838e870502a914ccfceac7e656b0dfa12fc0ff7..1cfe935e584468d6a127f779b7ec900ac6483b1b 100644 (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);
                }
        }
 
index e2c7fa26e660e7a2067f2469a16807b75ae73245..54d587715bf72bce5762aa725c26408b407f7065 100644 (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);
                                }
                        }