Transfer ownership only analyze home storage

When transferring ownership, only the local files will be transferred
during the rename operation. This means that the analyzing code doesn't
need to recurse into any mount points.

Furthermore this fixes issues where FailedStorage might appear as mount
points as a result of inaccessible external storages or shares. So this
makes it more robust.
This commit is contained in:
Vincent Petry 2016-11-02 19:53:23 +01:00 committed by Roeland Jago Douma
parent cebb689925
commit f31b794add
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 0 deletions

View File

@ -157,6 +157,11 @@ class TransferOwnership extends Command {
$this->walkFiles($view, "$this->sourceUser/files",
function (FileInfo $fileInfo) use ($progress, $self) {
if ($fileInfo->getType() === FileInfo::TYPE_FOLDER) {
// only analyze into folders from main storage,
// sub-storages have an empty internal path
if ($fileInfo->getInternalPath() === '' && $fileInfo->getPath() !== '') {
return false;
}
return true;
}
$progress->advance();