\r
/**\r
* Remove columns from array $arr that aren't in table $table\r
- * \r
+ *\r
* @param string $table Table name\r
* @param array &$arr Column=>Value array from json (by ref)\r
*/\r
\r
/**\r
* Import data into table $table\r
- * \r
+ *\r
* @param string $table Table name\r
* @param array $arr Column=>Value array from json\r
*/\r
$newuid = last_insert_id();\r
//~ $newuid = 1;\r
\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",\r
+ dbesc(generate_user_guid()), intval($newuid));\r
\r
foreach ($account['profile'] as &$profile) {\r
foreach ($profile as $k => &$v) {\r
$v = str_replace($oldbaseurl, $newbaseurl, $v);\r
foreach (array("profile", "avatar") as $k)\r
- $v = str_replace($newbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);\r
+ $v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);\r
}\r
$profile['uid'] = $newuid;\r
$r = db_import_assoc('profile', $profile);\r
foreach ($contact as $k => &$v) {\r
$v = str_replace($oldbaseurl, $newbaseurl, $v);\r
foreach (array("profile", "avatar", "micro") as $k)\r
- $v = str_replace($newbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);\r
+ $v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);\r
}\r
}\r
if ($contact['uid'] == $olduid && $contact['self'] == '0') {\r
// set contacts 'avatar-date' to "0000-00-00 00:00:00" to let poller to update urls\r
$contact["avatar-date"] = "0000-00-00 00:00:00" ;\r
- \r
- \r
+\r
+\r
switch ($contact['network']) {\r
case NETWORK_DFRN:\r
// 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
}\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