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
$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);