Merge pull request #1813 from annando/1508-newguid

Diaspora now uses a 32 digit guid.
This commit is contained in:
Tobias Diekershoff 2015-08-13 06:22:19 +02:00
commit 645dc13455
2 changed files with 3 additions and 2 deletions

View File

@ -1788,7 +1788,7 @@ function return_bytes ($size_str) {
function generate_user_guid() { function generate_user_guid() {
$found = true; $found = true;
do { do {
$guid = random_string(16); $guid = get_guid(32);
$x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1", $x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
dbesc($guid) dbesc($guid)
); );

View File

@ -157,7 +157,8 @@ function import_account(&$a, $file) {
//~ $newuid = 1; //~ $newuid = 1;
// Generate a new guid for the account. Otherwise there will be problems with diaspora // Generate a new guid for the account. Otherwise there will be problems with diaspora
q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d", generate_user_guid(), $newuid); q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d",
dbesc(generate_user_guid()), intval($newuid));
foreach ($account['profile'] as &$profile) { foreach ($account['profile'] as &$profile) {
foreach ($profile as $k => &$v) { foreach ($profile as $k => &$v) {