]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/UserImport.php
Remove duplicate profile_uid key in App->profile array
[friendica.git] / src / Core / UserImport.php
index ae9bd944cee6fca17333703d664e1fe3a54d5863..c77674127af5b55e5f161f77f512b5a64b81be1d 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Util\Strings;
 use Friendica\Worker\Delivery;
 
 /**
- * @brief UserImport class
+ * UserImport class
  */
 class UserImport
 {
@@ -84,7 +84,7 @@ class UserImport
        }
 
        /**
-        * @brief Import account file exported from mod/uexport
+        * Import account file exported from mod/uexport
         *
         * @param array $file array from $_FILES
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
@@ -104,13 +104,13 @@ class UserImport
 
                $account = json_decode(file_get_contents($file['tmp_name']), true);
                if ($account === null) {
-                       notice(L10n::t("Error decoding account file"));
+                       notice(DI::l10n()->t("Error decoding account file"));
                        return;
                }
 
 
                if (empty($account['version'])) {
-                       notice(L10n::t("Error! No version data in file! This is not a Friendica account file?"));
+                       notice(DI::l10n()->t("Error! No version data in file! This is not a Friendica account file?"));
                        return;
                }
 
@@ -118,7 +118,7 @@ class UserImport
                // check if username matches deleted account
                if (DBA::exists('user', ['nickname' => $account['user']['nickname']])
                        || DBA::exists('userd', ['username' => $account['user']['nickname']])) {
-                       notice(L10n::t("User '%s' already exists on this server!", $account['user']['nickname']));
+                       notice(DI::l10n()->t("User '%s' already exists on this server!", $account['user']['nickname']));
                        return;
                }
 
@@ -154,7 +154,7 @@ class UserImport
                $r = self::dbImportAssoc('user', $account['user']);
                if ($r === false) {
                        Logger::log("uimport:insert user : ERROR : " . DBA::errorMessage(), Logger::INFO);
-                       notice(L10n::t("User creation error"));
+                       notice(DI::l10n()->t("User creation error"));
                        return;
                }
                $newuid = self::lastInsertId();
@@ -172,7 +172,7 @@ class UserImport
                        $r = self::dbImportAssoc('profile', $profile);
                        if ($r === false) {
                                Logger::log("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), Logger::INFO);
-                               info(L10n::t("User profile creation error"));
+                               info(DI::l10n()->t("User profile creation error"));
                                DBA::delete('user', ['uid' => $newuid]);
                                return;
                        }
@@ -216,7 +216,7 @@ class UserImport
                        }
                }
                if ($errorcount > 0) {
-                       notice(L10n::tt("%d contact not imported", "%d contacts not imported", $errorcount));
+                       notice(DI::l10n()->tt("%d contact not imported", "%d contacts not imported", $errorcount));
                }
 
                foreach ($account['group'] as &$group) {
@@ -281,7 +281,7 @@ class UserImport
                // send relocate messages
                Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::RELOCATION, $newuid);
 
-               info(L10n::t("Done. You can now login with your username and password"));
+               info(DI::l10n()->t("Done. You can now login with your username and password"));
                DI::baseUrl()->redirect('login');
        }
 }