mirror of
https://github.com/nextcloud/server.git
synced 2024-11-14 12:26:49 +00:00
16833aff86
Currently there is a problem if an exception is thrown in `User::delete`, because at that point the user is already removed from the backend, but not all data is deleted. There is no way to recover from this state, as the user is gone no information is available anymore. This means the data is still available on the server but can not removed by any API anymore. The solution here is to first set a flag and backup the user home, this can be used to recover failed user deletions in a way the delete can be re-tried. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
31 lines
691 B
PHP
31 lines
691 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
namespace OC\Repair;
|
|
|
|
use OC\User\BackgroundJobs\CleanupDeletedUsers;
|
|
use OCP\BackgroundJob\IJobList;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\IRepairStep;
|
|
|
|
class AddCleanupDeletedUsersBackgroundJob implements IRepairStep {
|
|
private IJobList $jobList;
|
|
|
|
public function __construct(IJobList $jobList) {
|
|
$this->jobList = $jobList;
|
|
}
|
|
|
|
public function getName(): string {
|
|
return 'Add cleanup-deleted-users background job';
|
|
}
|
|
|
|
public function run(IOutput $output) {
|
|
$this->jobList->add(CleanupDeletedUsers::class);
|
|
}
|
|
}
|