summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-03-08 10:59:22 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-03-08 10:59:22 -0500
commit20828488bc99ceb22516367f8c6be02cb300a882 (patch)
tree5c1c025c92f52ada4fb551d7bade0e7b5badcd05 /apps
parent2d00d13a5d8f8607897455befb15c81b651c4db3 (diff)
downloadnextcloud-server-20828488bc99ceb22516367f8c6be02cb300a882.tar.gz
nextcloud-server-20828488bc99ceb22516367f8c6be02cb300a882.zip
Fix share hook for updater
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/updater.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index 66f0d30c77b..69219db8cb3 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -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;
+ }
+ }
}
}