This commit is contained in:
@@ -58,8 +58,10 @@ namespace AyaNova.Biz
|
|||||||
inObj.Salt = Hasher.GenerateSalt();
|
inObj.Salt = Hasher.GenerateSalt();
|
||||||
inObj.Password = Hasher.hash(inObj.Salt, inObj.Password);
|
inObj.Password = Hasher.hash(inObj.Salt, inObj.Password);
|
||||||
|
|
||||||
|
|
||||||
inObj.Tags = TagUtil.NormalizeTags(inObj.Tags);
|
inObj.Tags = TagUtil.NormalizeTags(inObj.Tags);
|
||||||
|
inObj.CustomFields=JsonUtil.CompactJson(inObj.CustomFields);
|
||||||
|
|
||||||
//Seeder sets user options in advance so no need to create them here in that case
|
//Seeder sets user options in advance so no need to create them here in that case
|
||||||
if (inObj.UserOptions == null)
|
if (inObj.UserOptions == null)
|
||||||
inObj.UserOptions = new UserOptions();
|
inObj.UserOptions = new UserOptions();
|
||||||
@@ -99,8 +101,10 @@ namespace AyaNova.Biz
|
|||||||
//This is a new user so it will have been posted with a password in plaintext which needs to be salted and hashed
|
//This is a new user so it will have been posted with a password in plaintext which needs to be salted and hashed
|
||||||
inObj.Salt = Hasher.GenerateSalt();
|
inObj.Salt = Hasher.GenerateSalt();
|
||||||
inObj.Password = Hasher.hash(inObj.Salt, inObj.Password);
|
inObj.Password = Hasher.hash(inObj.Salt, inObj.Password);
|
||||||
|
|
||||||
inObj.Tags = TagUtil.NormalizeTags(inObj.Tags);
|
inObj.Tags = TagUtil.NormalizeTags(inObj.Tags);
|
||||||
|
inObj.CustomFields=JsonUtil.CompactJson(inObj.CustomFields);
|
||||||
|
|
||||||
//Seeder sets user options in advance so no need to create them here in that case
|
//Seeder sets user options in advance so no need to create them here in that case
|
||||||
if (inObj.UserOptions == null)
|
if (inObj.UserOptions == null)
|
||||||
inObj.UserOptions = new UserOptions();
|
inObj.UserOptions = new UserOptions();
|
||||||
@@ -256,7 +260,7 @@ namespace AyaNova.Biz
|
|||||||
//put
|
//put
|
||||||
internal bool Put(User dbObj, User inObj)
|
internal bool Put(User dbObj, User inObj)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
//Get a snapshot of the original db value object before changes
|
//Get a snapshot of the original db value object before changes
|
||||||
User SnapshotOfOriginalDBObj = new User();
|
User SnapshotOfOriginalDBObj = new User();
|
||||||
@@ -265,6 +269,7 @@ namespace AyaNova.Biz
|
|||||||
//Update the db object with the PUT object values
|
//Update the db object with the PUT object values
|
||||||
CopyObject.Copy(inObj, dbObj, "Id, Salt");
|
CopyObject.Copy(inObj, dbObj, "Id, Salt");
|
||||||
dbObj.Tags = TagUtil.NormalizeTags(dbObj.Tags);
|
dbObj.Tags = TagUtil.NormalizeTags(dbObj.Tags);
|
||||||
|
dbObj.CustomFields = JsonUtil.CompactJson(dbObj.CustomFields);
|
||||||
|
|
||||||
//Is the user updating the password?
|
//Is the user updating the password?
|
||||||
if (!string.IsNullOrWhiteSpace(inObj.Password) && SnapshotOfOriginalDBObj.Password != inObj.Password)
|
if (!string.IsNullOrWhiteSpace(inObj.Password) && SnapshotOfOriginalDBObj.Password != inObj.Password)
|
||||||
@@ -314,6 +319,7 @@ namespace AyaNova.Biz
|
|||||||
//Do the patching
|
//Do the patching
|
||||||
objectPatch.ApplyTo(dbObj);
|
objectPatch.ApplyTo(dbObj);
|
||||||
dbObj.Tags = TagUtil.NormalizeTags(dbObj.Tags);
|
dbObj.Tags = TagUtil.NormalizeTags(dbObj.Tags);
|
||||||
|
dbObj.CustomFields=JsonUtil.CompactJson(dbObj.CustomFields);
|
||||||
|
|
||||||
//Is the user patching the password?
|
//Is the user patching the password?
|
||||||
if (!string.IsNullOrWhiteSpace(dbObj.Password) && dbObj.Password != SnapshotOfOriginalDBObj.Password)
|
if (!string.IsNullOrWhiteSpace(dbObj.Password) && dbObj.Password != SnapshotOfOriginalDBObj.Password)
|
||||||
@@ -568,7 +574,7 @@ namespace AyaNova.Biz
|
|||||||
return new
|
return new
|
||||||
{
|
{
|
||||||
Id = o.Id,
|
Id = o.Id,
|
||||||
ConcurrencyToken = o.ConcurrencyToken,
|
ConcurrencyToken = o.ConcurrencyToken,
|
||||||
Active = o.Active,
|
Active = o.Active,
|
||||||
Name = o.Name,
|
Name = o.Name,
|
||||||
Roles = o.Roles,
|
Roles = o.Roles,
|
||||||
|
|||||||
Reference in New Issue
Block a user