|
|
|
|
@ -50,10 +50,14 @@ class Updater { |
|
|
|
|
|
|
|
|
|
$shareManager = \OC::$server->getShareManager(); |
|
|
|
|
|
|
|
|
|
// We intentionally include invalid shares, as they have been automatically invalidated due to the node no longer |
|
|
|
|
// being accessible for the user. Only in this case where we adjust the share after it was moved we want to ignore |
|
|
|
|
// this to be able to still adjust it. |
|
|
|
|
|
|
|
|
|
// FIXME: should CIRCLES be included here ?? |
|
|
|
|
$shares = $shareManager->getSharesBy($user->getUID(), IShare::TYPE_USER, $src, false, -1); |
|
|
|
|
$shares = array_merge($shares, $shareManager->getSharesBy($user->getUID(), IShare::TYPE_GROUP, $src, false, -1)); |
|
|
|
|
$shares = array_merge($shares, $shareManager->getSharesBy($user->getUID(), IShare::TYPE_ROOM, $src, false, -1)); |
|
|
|
|
$shares = $shareManager->getSharesBy($user->getUID(), IShare::TYPE_USER, $src, false, -1, onlyValid: false); |
|
|
|
|
$shares = array_merge($shares, $shareManager->getSharesBy($user->getUID(), IShare::TYPE_GROUP, $src, false, -1, onlyValid: false)); |
|
|
|
|
$shares = array_merge($shares, $shareManager->getSharesBy($user->getUID(), IShare::TYPE_ROOM, $src, false, -1, onlyValid: false)); |
|
|
|
|
|
|
|
|
|
if ($src instanceof Folder) { |
|
|
|
|
$cacheAccess = Server::get(FileAccess::class); |
|
|
|
|
@ -61,9 +65,9 @@ class Updater { |
|
|
|
|
$sourceStorageId = $src->getStorage()->getCache()->getNumericStorageId(); |
|
|
|
|
$sourceInternalPath = $src->getInternalPath(); |
|
|
|
|
$subShares = array_merge( |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_USER), |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_GROUP), |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_ROOM), |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_USER, onlyValid: false), |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_GROUP, onlyValid: false), |
|
|
|
|
$shareManager->getSharesBy($user->getUID(), IShare::TYPE_ROOM, onlyValid: false), |
|
|
|
|
); |
|
|
|
|
$shareSourceIds = array_map(fn (IShare $share) => $share->getNodeId(), $subShares); |
|
|
|
|
$shareSources = $cacheAccess->getByFileIdsInStorage($shareSourceIds, $sourceStorageId); |
|
|
|
|
@ -111,7 +115,7 @@ class Updater { |
|
|
|
|
|
|
|
|
|
$share->setShareOwner($newOwner); |
|
|
|
|
$share->setPermissions($newPermissions); |
|
|
|
|
$shareManager->updateShare($share); |
|
|
|
|
$shareManager->updateShare($share, onlyValid: false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|