This commit is contained in:
2018-09-26 22:03:21 +00:00
parent c6ef933c99
commit 07e1f8b94a
4 changed files with 16 additions and 13 deletions

View File

@@ -23,10 +23,10 @@ namespace AyaNova.Biz
{ {
switch (aytype) switch (aytype)
{ {
case AyaType.User: case AyaType.User:
return new UserBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, roles); return new UserBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, roles);
case AyaType.Widget: case AyaType.Widget:
return new WidgetBiz(dbcontext, userId, roles); return new WidgetBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, roles);
case AyaType.Tag: case AyaType.Tag:
return new TagBiz(dbcontext, userId, roles); return new TagBiz(dbcontext, userId, roles);
case AyaType.TagMap: case AyaType.TagMap:
@@ -37,7 +37,7 @@ namespace AyaNova.Biz
return new ImportAyaNova7Biz(dbcontext, userId, roles); return new ImportAyaNova7Biz(dbcontext, userId, roles);
case AyaType.TrialSeeder: case AyaType.TrialSeeder:
return new TrialBiz(dbcontext, userId, roles); return new TrialBiz(dbcontext, userId, roles);
case AyaType.Locale: case AyaType.Locale:
return new LocaleBiz(dbcontext, userId, roles); return new LocaleBiz(dbcontext, userId, roles);

View File

@@ -67,7 +67,9 @@ namespace AyaNova.Biz
//do stuff with User //do stuff with User
User outObj = inObj; User outObj = inObj;
outObj.OwnerId = UserId; outObj.OwnerId = UserId;
outObj.UserOptions = new UserOptions(UserId); //Seeder sets user options in advance so no need to create them here in that case
if(outObj.UserOptions==null)
outObj.UserOptions = new UserOptions(UserId);
await ct.User.AddAsync(outObj); await ct.User.AddAsync(outObj);
//save to get Id //save to get Id
@@ -75,11 +77,11 @@ namespace AyaNova.Biz
//Handle child and associated items //Handle child and associated items
//Associated user options object // //Associated user options object
UserOptions options = new UserOptions(UserId); // UserOptions options = new UserOptions(UserId);
options.User = outObj; // options.User = outObj;
ct.UserOptions.Add(options); // ct.UserOptions.Add(options);
await ct.SaveChangesAsync(); // await ct.SaveChangesAsync();
//Log event //Log event
EventLogProcessor.AddEntry(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct); EventLogProcessor.AddEntry(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);

View File

@@ -233,7 +233,7 @@ namespace AyaNova.Util
u.OwnerId = 1; u.OwnerId = 1;
var p = new Bogus.Person(); var p = new Bogus.Person();
u.Name = p.FullName; u.Name = p.FullName;
u.Salt = Hasher.GenerateSalt(); // u.Salt = Hasher.GenerateSalt();
if (login != null) if (login != null)
{ {
u.Login = login; u.Login = login;
@@ -241,10 +241,11 @@ namespace AyaNova.Util
} }
else else
u.Login = p.FirstName; u.Login = p.FirstName;
if (password != null) if (password != null)
u.Password = Hasher.hash(u.Salt, password); u.Password = password;//u.Password = Hasher.hash(u.Salt, password);
else else
u.Password = Hasher.hash(u.Salt, u.Login); u.Password = u.Login;//u.Password = Hasher.hash(u.Salt, u.Login);
u.Roles = roles; u.Roles = roles;
u.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID; u.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID;
u.UserType = userType; u.UserType = userType;

View File

@@ -41,7 +41,7 @@ namespace raven_integration
ApiResponse a = await Util.PostAsync("Auth", null, creds.ToString()); ApiResponse a = await Util.PostAsync("Auth", null, creds.ToString());
//Put this in when having concurrency issue during auth and old style dl token creation during login //Put this in when having concurrency issue during auth and old style dl token creation during login
//ValidateDataReturnResponseOk(a); ValidateDataReturnResponseOk(a);
authDict[login] = a.ObjectResponse["result"]["token"].Value<string>(); authDict[login] = a.ObjectResponse["result"]["token"].Value<string>();
} }