diff --git a/lib/Command/Export.php b/lib/Command/Export.php index e16fc8b8..018670a7 100644 --- a/lib/Command/Export.php +++ b/lib/Command/Export.php @@ -55,6 +55,11 @@ protected function configure(): void { 'Comma-separated list of data type ids, pass --types=none 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, @@ -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);