This commit is contained in:
@@ -159,15 +159,15 @@ namespace AyaNova.Biz
|
|||||||
dbObj.Salt = SnapshotOfOriginalDBObj.Salt;
|
dbObj.Salt = SnapshotOfOriginalDBObj.Salt;
|
||||||
}
|
}
|
||||||
//Updating login?
|
//Updating login?
|
||||||
if (!string.IsNullOrWhiteSpace(inObj.Login))
|
if (!string.IsNullOrWhiteSpace(inObj.Login))
|
||||||
{
|
{
|
||||||
//YES Login is being updated:
|
//YES Login is being updated:
|
||||||
dbObj.Login=inObj.Login;
|
dbObj.Login = inObj.Login;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//No, use the original value
|
//No, use the original value
|
||||||
dbObj.Login = SnapshotOfOriginalDBObj.Login;
|
dbObj.Login = SnapshotOfOriginalDBObj.Login;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -212,16 +212,16 @@ namespace AyaNova.Biz
|
|||||||
dbObj.Password = Hasher.hash(dbObj.Salt, dbObj.Password);
|
dbObj.Password = Hasher.hash(dbObj.Salt, dbObj.Password);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Updating login?
|
//Updating login?
|
||||||
if (!string.IsNullOrWhiteSpace(dbObj.Login) && dbObj.Login != SnapshotOfOriginalDBObj.Login)
|
if (!string.IsNullOrWhiteSpace(dbObj.Login) && dbObj.Login != SnapshotOfOriginalDBObj.Login)
|
||||||
{
|
{
|
||||||
//YES Login is being updated:
|
//YES Login is being updated:
|
||||||
dbObj.Login=SnapshotOfOriginalDBObj.Login;
|
dbObj.Login = SnapshotOfOriginalDBObj.Login;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//No, use the original value
|
//No, use the original value
|
||||||
dbObj.Login = SnapshotOfOriginalDBObj.Login;
|
dbObj.Login = SnapshotOfOriginalDBObj.Login;
|
||||||
}
|
}
|
||||||
|
|
||||||
ct.Entry(dbObj).OriginalValues["ConcurrencyToken"] = concurrencyToken;
|
ct.Entry(dbObj).OriginalValues["ConcurrencyToken"] = concurrencyToken;
|
||||||
@@ -364,7 +364,11 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//LOGIN must be unique
|
||||||
|
if (await ct.User.AnyAsync(m => m.Login == proposedObj.Login && m.Id != proposedObj.Id))
|
||||||
|
{
|
||||||
|
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Login");
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Validation rules that require future other objects that aren't present yet:
|
//TODO: Validation rules that require future other objects that aren't present yet:
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace AyaNova.Util
|
|||||||
private const int DESIRED_SCHEMA_LEVEL = 11;
|
private const int DESIRED_SCHEMA_LEVEL = 11;
|
||||||
|
|
||||||
internal const long EXPECTED_COLUMN_COUNT = 272;
|
internal const long EXPECTED_COLUMN_COUNT = 272;
|
||||||
internal const long EXPECTED_INDEX_COUNT = 118;
|
internal const long EXPECTED_INDEX_COUNT = 119;
|
||||||
|
|
||||||
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
//Add user table
|
//Add user table
|
||||||
await ExecQueryAsync("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, active bool not null, name varchar(255) not null unique, " +
|
await ExecQueryAsync("CREATE TABLE auser (id BIGSERIAL PRIMARY KEY, active bool not null, name varchar(255) not null unique, " +
|
||||||
"login text not null, password text not null, salt text not null, roles integer not null, currentauthtoken text, " +
|
"login text not null unique, password text not null, salt text not null, roles integer not null, currentauthtoken text, " +
|
||||||
"dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " +
|
"dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " +
|
||||||
"headofficeid bigint, subvendorid bigint, wiki text null, customfields text, tags varchar(255) ARRAY)");
|
"headofficeid bigint, subvendorid bigint, wiki text null, customfields text, tags varchar(255) ARRAY)");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user