Update Shared folders ETags of users with reshares

This commit is contained in:
Michael Gapczynski 2013-03-06 17:33:27 -05:00
parent 771e01af35
commit 812e306e6e
1 changed files with 11 additions and 5 deletions

View File

@ -35,12 +35,18 @@ class Shared_Updater {
// Correct Shared folders of other users shared with // Correct Shared folders of other users shared with
$users = \OCP\Share::getUsersItemShared('file', $info['fileid'], $uidOwner, true); $users = \OCP\Share::getUsersItemShared('file', $info['fileid'], $uidOwner, true);
if (!empty($users)) { if (!empty($users)) {
foreach ($users as $user) { while (!empty($users)) {
// The ETag of the logged in user should already be updated $reshareUsers = array();
if ($user !== $uid) { foreach ($users as $user) {
$etag = \OC\Files\Filesystem::getETag(''); // The ETag of the logged in user should already be updated
\OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag); 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 // Correct folders of shared file owner
$target = substr($target, 8); $target = substr($target, 8);