Core item disposability
This commit is contained in:
@@ -12,7 +12,7 @@ using System.Text.RegularExpressions;
|
||||
namespace Sarand.Net.Standard.Dbas.Base
|
||||
{
|
||||
//=======================================================================
|
||||
public class SacsDatabaseConsole : SaErrorStateItem
|
||||
public class SacsDatabaseConsole : SacsDisposableStateItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Database configuration
|
||||
|
||||
@@ -223,8 +223,7 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
public override bool LoginUser(SysId userId, bool recordLastLogin = true)
|
||||
{
|
||||
ClearErrorState();
|
||||
using (SaSecurityItem secItemUser = securityMgr.GetSecurityItemById(userId))
|
||||
{
|
||||
SaSecurityItem secItemUser = securityMgr.GetSecurityItemById(userId);
|
||||
if (secItemUser == null || secItemUser.ItemType != SaSecurity.ItemType.User || !secItemUser.IsStatusEnabled)
|
||||
{
|
||||
SaLogger.Error($"{SysUtil.Fn}Failed to retrieve user for login. Id: {SysId.ToString(userId)} - {securityMgr.ErrorStateMessage}", true);
|
||||
@@ -237,7 +236,6 @@ namespace Sarand.Net.Standard.Dbas.Security
|
||||
SaLogger.Error($"{SysUtil.Fn}Failed to update user on login. Id: {SysId.ToString(userId)}' - {securityMgr.ErrorStateMessage}", true);
|
||||
}
|
||||
OnLogin(secItemUser != null ? secItemUser.Id : null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public override bool LoginAuthenticatedUser()
|
||||
|
||||
Reference in New Issue
Block a user