X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fuimport.php;h=4cc5b6c04b3f14d17b87c6c9d254968f4bdd54fc;hb=8c68a845230f89bf76e53571950a49eba99f98eb;hp=51672d92b6a27919704028408f8aa550b94e719c;hpb=6a8a36f12d00f35004fbb034972ca87dd1a3c4f5;p=friendica.git diff --git a/include/uimport.php b/include/uimport.php index 51672d92b6..4cc5b6c04b 100644 --- a/include/uimport.php +++ b/include/uimport.php @@ -11,14 +11,11 @@ define("IMPORT_DEBUG", False); function last_insert_id() { global $db; + if (IMPORT_DEBUG) return 1; - if ($db->mysqli) { - $thedb = $db->getdb(); - return $thedb->insert_id; - } else { - return mysql_insert_id(); - } + + return $db->insert_id(); } function last_error() { @@ -78,7 +75,7 @@ function import_cleanup($newuid) { q("DELETE FROM `pconfig` WHERE uid = %d", $newuid); } -function import_account(&$a, $file) { +function import_account(App $a, $file) { logger("Start user import from " . $file['tmp_name']); /* STEPS @@ -133,7 +130,7 @@ function import_account(&$a, $file) { } $oldbaseurl = $account['baseurl']; - $newbaseurl = $a->get_baseurl(); + $newbaseurl = App::get_baseurl(); $olduid = $account['user']['uid']; unset($account['user']['uid']); @@ -186,8 +183,8 @@ function import_account(&$a, $file) { } } if ($contact['uid'] == $olduid && $contact['self'] == '0') { - // set contacts 'avatar-date' to "0000-00-00 00:00:00" to let poller to update urls - $contact["avatar-date"] = "0000-00-00 00:00:00" ; + // set contacts 'avatar-date' to NULL_DATE to let poller to update urls + $contact["avatar-date"] = NULL_DATE; switch ($contact['network']) { @@ -290,5 +287,5 @@ function import_account(&$a, $file) { proc_run(PRIORITY_HIGH, 'include/notifier.php', 'relocate', $newuid); info(t("Done. You can now login with your username and password")); - goaway($a->get_baseurl() . "/login"); + goaway(App::get_baseurl() . "/login"); }