Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/Command/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ protected function configure(): void {
'Comma-separated list of data type ids, pass <comment>--types=none</comment> to only export base user data',
false,
)
->addOption(
'disable',
mode: InputOption::VALUE_NONE,
description: 'Disable the user before starting the export.',
)
->addArgument(
'user',
InputArgument::REQUIRED,
Expand Down Expand Up @@ -154,6 +159,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$partSuffix = '.part';
$exportPath = "$folder/$exportName.zip$partSuffix";

if ($input->getOption('disable')) {
$user->setEnabled(false);
$io->writeln('User ' . $user->getUID() . ' was disabled');
}

$resource = fopen($exportPath, 'w');
$exportDestination = new ExportDestination($resource, $exportPath);
$this->migrationService->export($exportDestination, $user, $selectedMigrators, $io);
Expand Down