mirror of
https://github.com/nextcloud/server.git
synced 2026-07-05 07:48:39 -04:00
Merge pull request #31445 from nextcloud/backport/30953/stable23
[stable23] Init user's file system if not existing on ownership transfer
This commit is contained in:
commit
f8c7124ea4
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