]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix correctFolders and retrieve the correct storage cache
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 8 Mar 2013 19:27:30 +0000 (14:27 -0500)
committerMichael Gapczynski <mtgap@owncloud.com>
Fri, 8 Mar 2013 19:27:30 +0000 (14:27 -0500)
apps/files_sharing/lib/cache.php
apps/files_sharing/lib/updater.php

index 6f834e08999fca1986048a667577d88e283dba5a..9fccd0b46f32481684e993d66b081cd4580b5cf0 100644 (file)
@@ -42,16 +42,19 @@ class Shared_Cache extends Cache {
         */
        private function getSourceCache($target) {
                $source = \OC_Share_Backend_File::getSource($target);
-               if (isset($source['path'])) {
-                       $source['path'] = '/' . $source['uid_owner'] . '/' . $source['path'];
-                       \OC\Files\Filesystem::initMountPoints($source['uid_owner']);
-                       list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source['path']);
-                       if ($storage) {
-                               $this->files[$target] = $internalPath;
-                               $cache = $storage->getCache();
-                               $this->storageId = $storage->getId();
-                               $this->numericId = $cache->getNumericStorageId();
-                               return $cache;
+               if (isset($source['path']) && isset($source['fileOwner'])) {
+                       \OC\Files\Filesystem::initMountPoints($source['fileOwner']);
+                       $mount = \OC\Files\Mount::findByNumericId($source['storage']);
+                       if ($mount) {
+                               $fullPath = $mount->getMountPoint().$source['path'];
+                               list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($fullPath);
+                               if ($storage) {
+                                       $this->files[$target] = $internalPath;
+                                       $cache = $storage->getCache();
+                                       $this->storageId = $storage->getId();
+                                       $this->numericId = $cache->getNumericStorageId();
+                                       return $cache;
+                               }
                        }
                }
                return false;
index 861025c593374ddbb4e85aa992baf808ff61a9e0..73e7808f24a08625fa50246dec64063935bd05a5 100644 (file)
@@ -38,13 +38,10 @@ class Shared_Updater {
                        while (!empty($users)) {
                                $reshareUsers = array();
                                foreach ($users as $user) {
-                                       // The ETag of the logged in user should already be updated
-                                       if ($user !== $uid) {
-                                               $etag = \OC\Files\Filesystem::getETag('');
-                                               \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
-                                               // Look for reshares
-                                               $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
-                                       }
+                                       $etag = \OC\Files\Filesystem::getETag('');
+                                       \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
+                                       // Look for reshares
+                                       $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
                                }
                                $users = $reshareUsers;
                        }