Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions apps/dav/lib/UserMigration/CalendarMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,25 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface
}
}
}

/**
* {@inheritDoc}
*/
public function getId(): string {
return 'calendar';
}

/**
* {@inheritDoc}
*/
public function getDisplayName(): string {
return $this->l10n->t('Calendar');
}

/**
* {@inheritDoc}
*/
public function getDescription(): string {
return $this->l10n->t('Calendars including events, details, and attendees');
}
}
21 changes: 21 additions & 0 deletions apps/dav/lib/UserMigration/ContactsMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,4 +363,25 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface
}
}
}

/**
* {@inheritDoc}
*/
public function getId(): string {
return 'contacts';
}

/**
* {@inheritDoc}
*/
public function getDisplayName(): string {
return $this->l10n->t('Contacts');
}

/**
* {@inheritDoc}
*/
public function getDescription(): string {
return $this->l10n->t('Contacts and groups');
}
}
28 changes: 27 additions & 1 deletion apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\IUser;
use OCP\UserMigration\IExportDestination;
use OCP\UserMigration\IImportSource;
Expand All @@ -50,12 +51,16 @@ class TrashbinMigrator implements IMigrator {

protected IDBConnection $dbc;

protected IL10N $l10n;

public function __construct(
IRootFolder $rootFolder,
IDBConnection $dbc
IDBConnection $dbc,
IL10N $l10n
) {
$this->root = $rootFolder;
$this->dbc = $dbc;
$this->l10n = $l10n;
}

/**
Expand Down Expand Up @@ -134,4 +139,25 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface
$output->writeln("No trashbin to import…");
}
}

/**
* {@inheritDoc}
*/
public function getId(): string {
return 'trashbin';
}

/**
* {@inheritDoc}
*/
public function getDisplayName(): string {
return $this->l10n->t('Deleted files');
}

/**
* {@inheritDoc}
*/
public function getDescription(): string {
return $this->l10n->t('Deleted files and folders in the trash bin');
}
}
28 changes: 27 additions & 1 deletion apps/settings/lib/UserMigration/AccountMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use OCA\Settings\AppInfo\Application;
use OCP\Accounts\IAccountManager;
use OCP\IAvatarManager;
use OCP\IL10N;
use OCP\IUser;
use OCP\UserMigration\IExportDestination;
use OCP\UserMigration\IImportSource;
Expand All @@ -49,6 +50,8 @@ class AccountMigrator implements IMigrator {

private IAvatarManager $avatarManager;

private IL10N $l10n;

private const PATH_ROOT = Application::APP_ID . '/';

private const PATH_ACCOUNT_FILE = AccountMigrator::PATH_ROOT . 'account.json';
Expand All @@ -57,10 +60,12 @@ class AccountMigrator implements IMigrator {

public function __construct(
IAccountManager $accountManager,
IAvatarManager $avatarManager
IAvatarManager $avatarManager,
IL10N $l10n
) {
$this->accountManager = $accountManager;
$this->avatarManager = $avatarManager;
$this->l10n = $l10n;
}

/**
Expand Down Expand Up @@ -137,4 +142,25 @@ public function import(IUser $user, IImportSource $importSource, OutputInterface
}
}
}

/**
* {@inheritDoc}
*/
public function getId(): string {
return 'account';
}

/**
* {@inheritDoc}
*/
public function getDisplayName(): string {
return $this->l10n->t('Profile information');
}

/**
* {@inheritDoc}
*/
public function getDescription(): string {
return $this->l10n->t('Profile picture, full name, email, phone number, address, website, Twitter, organisation, role, headline, biography, and whether your profile is enabled');
}
}
21 changes: 21 additions & 0 deletions lib/public/UserMigration/IMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,27 @@ public function import(
OutputInterface $output
): void;

/**
* Returns the unique ID
*
* @since 24.0.0
*/
public function getId(): string;

/**
* Returns the display name
*
* @since 24.0.0
*/
public function getDisplayName(): string;

/**
* Returns the description
*
* @since 24.0.0
*/
public function getDescription(): string;

/**
* Returns the version of the export format for this migrator
*
Expand Down