Misc Updates (#665)
* Do not allow non-admins to change their passwords when authentication is disabled * Clean up the login page so that input field text is black * cleanup some resizing when typing a password and having a lot of users * Changed the LastActive for a user to not just be login, but also when they open an already authenticated session.
This commit is contained in:
parent
40ea4235fe
commit
70f324669b
10 changed files with 57 additions and 48 deletions
|
|
@ -140,7 +140,7 @@ namespace API.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
if (!_unitOfWork.HasChanges()) return Ok("Nothing was updated");
|
||||
if (!_unitOfWork.HasChanges()) return Ok(updateSettingsDto);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,15 +35,6 @@ namespace API.Data.Repositories
|
|||
return _mapper.Map<ServerSettingDto>(settings);
|
||||
}
|
||||
|
||||
public ServerSettingDto GetSettingsDto()
|
||||
{
|
||||
var settings = _context.ServerSetting
|
||||
.Select(x => x)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
return _mapper.Map<ServerSettingDto>(settings);
|
||||
}
|
||||
|
||||
public Task<ServerSetting> GetSettingAsync(ServerSettingKey key)
|
||||
{
|
||||
return _context.ServerSetting.SingleOrDefaultAsync(x => x.Key == key);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ namespace API.Interfaces.Repositories
|
|||
{
|
||||
void Update(ServerSetting settings);
|
||||
Task<ServerSettingDto> GetSettingsDtoAsync();
|
||||
ServerSettingDto GetSettingsDto();
|
||||
Task<ServerSetting> GetSettingAsync(ServerSettingKey key);
|
||||
Task<IEnumerable<ServerSetting>> GetSettingsAsync();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using API.Interfaces;
|
||||
|
|
@ -27,7 +28,7 @@ namespace API.SignalR.Presence
|
|||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
public Task UserConnected(string username, string connectionId)
|
||||
public async Task UserConnected(string username, string connectionId)
|
||||
{
|
||||
lock (OnlineUsers)
|
||||
{
|
||||
|
|
@ -41,7 +42,10 @@ namespace API.SignalR.Presence
|
|||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
// Update the last active for the user
|
||||
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(username);
|
||||
user.LastActive = DateTime.Now;
|
||||
await _unitOfWork.CommitAsync();
|
||||
}
|
||||
|
||||
public Task UserDisconnected(string username, string connectionId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue