This commit is contained in:
2018-08-31 16:38:21 +00:00
parent b5ccaa3c8e
commit b7c46370f8
3 changed files with 21 additions and 1 deletions

View File

@@ -72,6 +72,8 @@ IMPORTMAP
NOTES FOR DOCS
- Only an empty database is supported for import
- Only one shot import, can't import again later
- LOCALES
- MUST be a default locale set before import because new raven keys will be added to imported v7 locale using the default locale only
- IMPORTED USERS
- login and passwords are not imported and need to be setup again after import
- no Authorization Role is set and therefore no rights to anything. A role needs to be set after import for each user

View File

@@ -437,6 +437,13 @@ namespace AyaNova.Biz
}
}
//Now add keys that were added after v7 for RAVEN using default locale values
foreach(string s in ValidKeys){
if(!NewLocaleDict.ContainsKey(s)){
NewLocaleDict.Add(s,GetDefaultLocalizedText(s).Result);
}
}
//Validate it's the correct number of keys expected
if (NewLocaleDict.Count != ValidKeys.Count)
{

View File

@@ -415,6 +415,14 @@ namespace AyaNova.Biz
{
var V7Id = new Guid(j["ID"].Value<string>());
//skip the administrator account but add it to the map for all the other import code that requires it
if (V7Id == new Guid("2ecc77fc-69e2-4a7e-b88d-bd0ecaf36aed"))
{
var mapItem = new ImportAyaNova7MapItem(V7Id, AyaType.User, 1);
importMap.Add(mapItem);
return true;
}
//Copy values
User i = new User();
i.Name = j["FirstName"].Value<string>() + " " + j["LastName"].Value<string>();
@@ -438,7 +446,10 @@ namespace AyaNova.Biz
i.Password = Hasher.hash(i.Salt, Hasher.GenerateSalt());
//No rights
i.Roles=AuthorizationRoles.NoRole;
i.Roles = AuthorizationRoles.NoRole;
//temporary locale id to satisfy db settings
i.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
User o = await CreateAsync(i);
if (HasErrors)