mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 22:41:13 -05:00
Init user's file system if not existing on ownership transfer
This makes it a bit easier to transfer ownership when the new user hasn't already logged in. This still doesn't support encrypted storages because the keys are not generated yet. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
2d9fad1bdd
commit
ab2ac33bf9
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