summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/updater.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-03-06 17:33:27 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-03-06 17:33:27 -0500
commit812e306e6e1a10b879052bccaa6b94a6bb8bf9f4 (patch)
tree741bde0d588af24800d5798cb68ec51f7d0cd615 /apps/files_sharing/lib/updater.php
parent771e01af35157f99539134ceae68a672e4cb36f9 (diff)
downloadnextcloud-server-812e306e6e1a10b879052bccaa6b94a6bb8bf9f4.tar.gz
nextcloud-server-812e306e6e1a10b879052bccaa6b94a6bb8bf9f4.zip
Update Shared folders ETags of users with reshares
Diffstat (limited to 'apps/files_sharing/lib/updater.php')
-rw-r--r--apps/files_sharing/lib/updater.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index cc04835b7d7..030180543c9 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -35,12 +35,18 @@ class Shared_Updater {
// Correct Shared folders of other users shared with
$users = \OCP\Share::getUsersItemShared('file', $info['fileid'], $uidOwner, true);
if (!empty($users)) {
- 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);
+ 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));
+ }
}
+ $users = $reshareUsers;
}
// Correct folders of shared file owner
$target = substr($target, 8);