From c631c4c4ed4c403ad152b2bdfc1c03f3ace48465 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 5 Nov 2012 08:23:21 +0000 Subject: add upgrade scripts. --- upgrades/2012100501.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 upgrades/2012100501.php (limited to 'upgrades') diff --git a/upgrades/2012100501.php b/upgrades/2012100501.php new file mode 100644 index 000000000..789a73e0a --- /dev/null +++ b/upgrades/2012100501.php @@ -0,0 +1,53 @@ +guid"); + } + + if ($user->alias) { + $alias = $user->alias; + if (strpos($alias, 'pg/profile') !== FALSE) { + $alias = str_replace('pg/profile', 'profile', $alias); + } + error_log($alias); + $user->annotate('openid_identifier', $alias, ACCESS_PUBLIC); + } + return true; +} + + + +/* + * Run upgrade. First users, then pads + */ +// users +$options = array('type' => 'user', 'limit' => 0); + +$MIGRATED = 0; + +$previous_access = elgg_set_ignore_access(true); +$batch = new ElggBatch('elgg_get_entities', $options, "openid_client_user_2012100501", 100); +elgg_set_ignore_access($previous_access); + +if ($batch->callbackResult) { + error_log("Elgg openid users upgrade (201210050) succeeded"); + elgg_set_plugin_setting('version', 2012022501, 'openid_client'); +} else { + error_log("Elgg openid users upgrade (201210050) failed"); +} + + -- cgit v1.2.3