1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fix bug with privileged users not always showing the most recent profile

temporary bans are now applied to all linked accounts instead of a per-guid basis
rework set level flow
add guid and ip address (if logged in) to public async endpoint
This commit is contained in:
RaidMax
2019-03-24 21:34:20 -05:00
parent 52b15e5061
commit fea974ee0f
15 changed files with 320 additions and 214 deletions

View File

@ -21,7 +21,6 @@ namespace SharedLibraryCore.Services
{
Level = Permission.User,
FirstConnection = DateTime.UtcNow,
Connections = 1,
LastConnection = DateTime.UtcNow,
Masked = false,
NetworkId = entity.NetworkId,
@ -356,11 +355,25 @@ namespace SharedLibraryCore.Services
}
}
/// <summary>
/// retrieves the number of owners
/// (client level is owner)
/// </summary>
/// <returns></returns>
public async Task<int> GetOwnerCount()
{
using (var ctx = new DatabaseContext(true))
{
return await ctx.Clients.AsNoTracking()
.CountAsync(_client => _client.Level == Permission.Owner);
}
}
public async Task<List<EFClient>> GetPrivilegedClients()
{
using (var context = new DatabaseContext(disableTracking: true))
{
var iqClients = from client in context.Clients
var iqClients = from client in context.Clients.AsNoTracking()
where client.Level >= Permission.Trusted
where client.Active
select new EFClient()