aboutsummaryrefslogtreecommitdiffstats
path: root/update.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-18 18:13:46 -0700
committerFriendika <info@friendika.com>2011-07-18 18:13:46 -0700
commitc0b8e63a3fe600326e0f18c03207ba9fd30c8126 (patch)
treea3eb8d1f518066101b881738d5f678c4d3a01d46 /update.php
parent25b4aacf3b53d4f82f7dc817bb1e022b2a61c1a3 (diff)
downloadvolse-hubzilla-c0b8e63a3fe600326e0f18c03207ba9fd30c8126.tar.gz
volse-hubzilla-c0b8e63a3fe600326e0f18c03207ba9fd30c8126.tar.bz2
volse-hubzilla-c0b8e63a3fe600326e0f18c03207ba9fd30c8126.zip
basic diaspora discovery
Diffstat (limited to 'update.php')
-rw-r--r--update.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/update.php b/update.php
index f2cd5573f..9c55f15cf 100644
--- a/update.php
+++ b/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1075 );
+define( 'UPDATE_VERSION' , 1076 );
/**
*
@@ -601,3 +601,26 @@ function update_1074() {
}
q("ALTER TABLE `profile` DROP `hidewall`");
}
+
+function update_1075() {
+ q("ALTER TABLE `user` ADD `guid` CHAR( 16 ) NOT NULL AFTER `uid` ");
+ $r = q("SELECT `uid` FROM `user` WHERE 1");
+ if(count($r)) {
+ foreach($r as $rr) {
+ $found = true;
+ do {
+ $guid = substr(random_string(),0,16);
+ $x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
+ dbesc($guid)
+ );
+ if(! count($x))
+ $found = false;
+ } while ($found == true );
+
+ q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d LIMIT 1",
+ dbesc($guid),
+ intval($rr['uid'])
+ );
+ }
+ }
+} \ No newline at end of file