]> source.dussan.org Git - nextcloud-server.git/commitdiff
Extend account migrator
authorChristopher Ng <chrng8@gmail.com>
Fri, 8 Apr 2022 19:19:29 +0000 (19:19 +0000)
committerChristopher Ng <chrng8@gmail.com>
Fri, 8 Apr 2022 19:31:22 +0000 (19:31 +0000)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/settings/lib/UserMigration/AccountMigrator.php

index e50a01e515f55c6bd2f89375c4c88a0f8b8e648d..a39c510813f73326e9bd683820e6dd553e21b32e 100644 (file)
@@ -32,6 +32,7 @@ use OC\NotSquareException;
 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;
@@ -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';
@@ -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;
        }
 
        /**
@@ -137,4 +142,25 @@ class AccountMigrator implements IMigrator {
                        }
                }
        }
+
+       /**
+        * {@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');
+       }
 }