MDL-13060 - upgrade path for users (re)created from backup files

This commit is contained in:
scyrma
2008-01-30 05:23:39 +00:00
parent 06e22959d1
commit bcdb377366
2 changed files with 18 additions and 0 deletions
+12
View File
@@ -2201,6 +2201,18 @@
$user->lang = 'mi_nt';
}
//Country list updates - MDL-13060
//Any user whose country code has been deleted or modified needs to be assigned a valid one.
$country_update_map = array(
'ZR' => 'CD',
'TP' => 'TL',
'FX' => 'FR',
'KO' => 'RS',
'CS' => 'RS',
'WA' => 'GB');
if (array_key_exists($user->country, $country_update_map)) {
$user->country = $country_update_map[$user->country];
}
//If language does not exist here - use site default
if (!array_key_exists($user->lang, $languages)) {
+6
View File
@@ -1,6 +1,12 @@
<?PHP // $Id$
// countries.php - created with Moodle 1.7 beta + (2006101003)
// http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm
//
// UPDATE NOTE - When country codes are deleted or re-assigned,
// you must re-assign users to a valid country, doing both:
// 1 - add an upgrade path in /lib/db/upgrade.php
// 2 - add a line in the $country_update_map array, in
// /backup/restorelib.php
$string['AF'] = 'Afghanistan';
$string['AX'] = 'Åland Islands';