mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
Unmount the share before deleting it, so we don't try to use it later on
This commit is contained in:
parent
6774f60240
commit
d857f7caf2
1 changed files with 6 additions and 0 deletions
|
|
@ -203,9 +203,15 @@ class TransferOwnership extends Command {
|
|||
private function restoreShares(OutputInterface $output) {
|
||||
$output->writeln("Restoring shares ...");
|
||||
$progress = new ProgressBar($output, count($this->shares));
|
||||
$mountManager = Filesystem::getMountManager($this->destinationUser);
|
||||
|
||||
foreach($this->shares as $share) {
|
||||
if ($share->getSharedWith() === $this->destinationUser) {
|
||||
// Unmount the shares before deleting, so we don't try to get the storage later on.
|
||||
$shareMountPoint = $mountManager->find('/' . $this->destinationUser . '/files' . $share->getTarget());
|
||||
if ($shareMountPoint) {
|
||||
$mountManager->removeMount($shareMountPoint->getMountPoint());
|
||||
}
|
||||
$this->shareManager->deleteShare($share);
|
||||
} else {
|
||||
if ($share->getShareOwner() === $this->sourceUser) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue