mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #31446 from nextcloud/backport/30953/stable22
[stable22] Init user's file system if not existing on ownership transfer
This commit is contained in:
commit
4ee10c85dd
1 changed files with 6 additions and 7 deletions
|
|
@ -144,13 +144,12 @@ class OwnershipTransferService {
|
|||
throw new TransferOwnershipException("Unknown path provided: $path", 1);
|
||||
}
|
||||
|
||||
if ($move && (
|
||||
!$view->is_dir($finalTarget) || (
|
||||
!$firstLogin &&
|
||||
count($view->getDirectoryContent($finalTarget)) > 0
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($move && !$view->is_dir($finalTarget)) {
|
||||
// Initialize storage
|
||||
\OC_Util::setupFS($destinationUser->getUID());
|
||||
}
|
||||
|
||||
if ($move && !$firstLogin && count($view->getDirectoryContent($finalTarget)) > 0) {
|
||||
throw new TransferOwnershipException("Destination path does not exists or is not empty", 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue