]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix share hook for updater
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 8 Mar 2013 15:59:22 +0000 (10:59 -0500)
committerMichael Gapczynski <mtgap@owncloud.com>
Fri, 8 Mar 2013 15:59:22 +0000 (10:59 -0500)
apps/files_sharing/lib/updater.php

index 66f0d30c77bb2b9e2dae8169bda1ac29191af3fb..69219db8cb36b10c34924752e6a17ed1a68896e5 100644 (file)
@@ -85,8 +85,20 @@ class Shared_Updater {
         */
        static public function shareHook($params) {
                if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') {
-                       $id = \OC\Files\Filesystem::getPath($params['fileSource']);
-                       self::correctFolders($id);
+                       $uidOwner = \OCP\User::getUser();
+                       $users = \OCP\Share::getUsersItemShared('file', $params['fileSource'], $uidOwner, true);
+                       if (!empty($users)) {
+                               while (!empty($users)) {
+                                       $reshareUsers = array();
+                                       foreach ($users as $user) {
+                                               $etag = \OC\Files\Filesystem::getETag('');
+                                               \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
+                                               // Look for reshares
+                                               $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $params['fileSource'], $user, true));
+                                       }
+                                       $users = $reshareUsers;
+                               }
+                       }
                }
        }