]> git.mxchange.org Git - friendica.git/blobdiff - include/uimport.php
Some notification thingy
[friendica.git] / include / uimport.php
index b8439ee0944c8192fec2557134db68c234f09bcb..0d9ffc35fca2f001fcf6df23db1f03a1e8fd8da5 100644 (file)
@@ -116,7 +116,7 @@ function import_account(&$a, $file) {
                notice(t('Error! Cannot check nickname'));\r
                return;\r
        }\r
-       if (count($r) > 0) {\r
+       if (dbm::is_result($r) > 0) {\r
                notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));\r
                return;\r
        }\r
@@ -127,13 +127,13 @@ function import_account(&$a, $file) {
                notice(t('Error! Cannot check nickname'));\r
                return;\r
        }\r
-       if (count($r) > 0) {\r
+       if (dbm::is_result($r) > 0) {\r
                notice(sprintf(t("User '%s' already exists on this server!"), $account['user']['nickname']));\r
                return;\r
        }\r
 \r
        $oldbaseurl = $account['baseurl'];\r
-       $newbaseurl = $a->get_baseurl();\r
+       $newbaseurl = App::get_baseurl();\r
        $olduid = $account['user']['uid'];\r
 \r
         unset($account['user']['uid']);\r
@@ -157,7 +157,8 @@ function import_account(&$a, $file) {
        //~ $newuid = 1;\r
 \r
        // Generate a new guid for the account. Otherwise there will be problems with diaspora\r
-       q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d", generate_user_guid(), $newuid);\r
+       q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d",\r
+               dbesc(generate_user_guid()), intval($newuid));\r
 \r
        foreach ($account['profile'] as &$profile) {\r
                foreach ($profile as $k => &$v) {\r
@@ -194,10 +195,10 @@ function import_account(&$a, $file) {
                                        //  send relocate message (below)\r
                                        break;\r
                                case NETWORK_ZOT:\r
-                                       // TODO handle zot network\r
+                                       /// @TODO handle zot network\r
                                        break;\r
                                case NETWORK_MAIL2:\r
-                                       // TODO ?\r
+                                       /// @TODO ?\r
                                        break;\r
                                case NETWORK_FEED:\r
                                case NETWORK_MAIL:\r
@@ -286,8 +287,8 @@ function import_account(&$a, $file) {
        }\r
 \r
        // send relocate messages\r
-       proc_run('php', 'include/notifier.php', 'relocate', $newuid);\r
+       proc_run(PRIORITY_HIGH, 'include/notifier.php', 'relocate', $newuid);\r
 \r
        info(t("Done. You can now login with your username and password"));\r
-       goaway($a->get_baseurl() . "/login");\r
+       goaway(App::get_baseurl() . "/login");\r
 }\r