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)
{
case AyaType.User:
case AyaType.User:
return new UserBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, roles);
case AyaType.Widget:
return new WidgetBiz(dbcontext, userId, roles);
return new WidgetBiz(dbcontext, userId, ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID, roles);
case AyaType.Tag:
return new TagBiz(dbcontext, userId, roles);
case AyaType.TagMap:
@@ -37,7 +37,7 @@ namespace AyaNova.Biz
return new ImportAyaNova7Biz(dbcontext, userId, roles);
case AyaType.TrialSeeder:
return new TrialBiz(dbcontext, userId, roles);
case AyaType.Locale:
case AyaType.Locale:
return new LocaleBiz(dbcontext, userId, roles);

View File

@@ -67,7 +67,9 @@ namespace AyaNova.Biz
//do stuff with User
User outObj = inObj;
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);
//save to get Id
@@ -75,11 +77,11 @@ namespace AyaNova.Biz
//Handle child and associated items
//Associated user options object
UserOptions options = new UserOptions(UserId);
options.User = outObj;
ct.UserOptions.Add(options);
await ct.SaveChangesAsync();
// //Associated user options object
// UserOptions options = new UserOptions(UserId);
// options.User = outObj;
// ct.UserOptions.Add(options);
// await ct.SaveChangesAsync();
//Log event
EventLogProcessor.AddEntry(new Event(UserId, outObj.Id, BizType, AyaEvent.Created), ct);

View File

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

View File

@@ -41,7 +41,7 @@ namespace raven_integration
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
//ValidateDataReturnResponseOk(a);
ValidateDataReturnResponseOk(a);
authDict[login] = a.ObjectResponse["result"]["token"].Value<string>();
}