]> git.mxchange.org Git - friendica.git/blobdiff - mod/uimport.php
Merge pull request #4297 from hoergen/develop
[friendica.git] / mod / uimport.php
index b9bde23880da767783a419a1b485c3430466b268..8516613410a00884eeff267843094ec5820890a7 100644 (file)
@@ -1,12 +1,12 @@
 <?php
-
 /**
- * View for user import
+ * @file mod/uimport.php
+ * @brief View for user import
  */
 
 use Friendica\App;
-
-require_once("include/uimport.php");
+use Friendica\Core\Config;
+use Friendica\Core\UserImport;
 
 function uimport_post(App $a) {
        switch ($a->config['register_policy']) {
@@ -33,7 +33,7 @@ function uimport_post(App $a) {
 
        if (x($_FILES, 'accountfile')) {
                /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
-               import_account($a, $_FILES['accountfile']);
+               UserImport::importAccount($a, $_FILES['accountfile']);
                return;
        }
 }
@@ -45,7 +45,7 @@ function uimport_content(App $a) {
                return;
        }
 
-       $max_dailies = intval(get_config('system', 'max_daily_registrations'));
+       $max_dailies = intval(Config::get('system', 'max_daily_registrations'));
        if ($max_dailies) {
                $r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
                if ($r && $r[0]['total'] >= $max_dailies) {
@@ -64,14 +64,14 @@ function uimport_content(App $a) {
        }
 
        $tpl = get_markup_template("uimport.tpl");
-       return replace_macros($tpl, array(
+       return replace_macros($tpl, [
                '$regbutt' => t('Import'),
-               '$import' => array(
+               '$import' => [
                        'title' => t("Move account"),
                        'intro' => t("You can import an account from another Friendica server."),
                        'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
                        'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
-                       'field' => array('accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
-               ),
-       ));
+                       'field' => ['accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
+               ],
+       ]);
 }