public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { var webCtx = context.WebContext; Guid?loginId = null; if (login != null) { loginId = login.Id; if (userName == null) { userName = login.UserName; } } else if (context.User.Kind == UserKind.AuthenticatedUser) { loginId = context.User.UserId; //most likely the same if (userName == null) { userName = context.User.UserName; } } var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName); _backgroundSave.AddObject(logEntry); }
/// <summary> /// Initializes LoginEventArgs instance. /// </summary> /// <param name="eventType">Login event type.</param> /// <param name="identity">Client's identity.</param> /// <param name="timestamp">Event timestamp.</param> public LoginEventArgs(LoginEventType eventType, IIdentity identity, DateTime timestamp) { EventType = eventType; Identity = identity; ClientAddress = string.Empty; Timestamp = timestamp; }
public ILoginLog GetLastEvent(Guid loginId, LoginEventType eventType) { var session = App.OpenSystemSession(); var evt = session.EntitySet <ILoginLog>().Where(l => l.LoginId == loginId && l.EventType == eventType.ToString()).OrderByDescending(l => l.CreatedOn).FirstOrDefault(); return(evt); }
/// <summary> /// Initializes LoginEventArgs instance. /// </summary> /// <param name="eventType">Login event type.</param> /// <param name="identity">Client's identity.</param> /// <param name="timestamp">Event timestamp.</param> public LoginEventArgs(LoginEventType eventType, IIdentity identity, DateTime timestamp) { EventType = eventType; Identity = identity; ClientAddress = string.Empty; Timestamp = timestamp; }
public void LogEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { var webCtx = context.WebContext; Guid? loginId = null; if(login != null) { loginId = login.Id; if(userName == null) userName = login.UserName; } var logEntry = new LoginLogEntry(context, loginId, eventType.ToString(), notes, userName); _backgroundSave.AddObject(logEntry); }
protected internal void OnLoginEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string message = null, string userName = null) { if (context == null && login != null) { context = EntityHelper.GetSession(login).Context; } context?.Log.AddEntry(new AppEventEntry(context.LogContext, "Login", eventType.ToString(), EventSeverity.Info, message: message, guidParam: login?.Id, stringParam: login?.UserName ?? userName)); var args = new LoginEventArgs(eventType, login, context); LoginEvent?.Invoke(this, args); }
protected internal void OnLoginEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string message = null, string userName = null) { if (context == null && login != null) { context = EntityHelper.GetSession(login).Context; } if (_logService != null) { _logService.AddEntry(new EventLogEntry("Login", eventType.ToString(), EventSeverity.Info, message: message, objectId: login?.Id, context: context, objectName: userName)); } var args = new LoginEventArgs(eventType, login, context); LoginEvent?.Invoke(this, args); }
protected internal void OnLoginEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { if (context == null && login != null) { context = EntityHelper.GetSession(login).Context; } if (_loginLog != null) { _loginLog.LogEvent(context, eventType, login, notes, userName); } var args = new LoginEventArgs(eventType, login, context); if (LoginEvent != null) { LoginEvent(this, args); } }
public ILoginLog GetLastEvent(Guid loginId, LoginEventType eventType) { var session = App.OpenSystemSession(); var evt = session.EntitySet<ILoginLog>().Where(l => l.LoginId == loginId && l.EventType == eventType.ToString()).OrderByDescending(l => l.CreatedOn).FirstOrDefault(); return evt; }
protected internal void OnLoginEvent(OperationContext context, LoginEventType eventType, ILogin login = null, string notes = null, string userName = null) { if(context == null && login != null) context = EntityHelper.GetSession(login).Context; if(_loginLog != null) _loginLog.LogEvent(context, eventType, login, notes, userName); var args = new LoginEventArgs(eventType, login, context); if(LoginEvent != null) LoginEvent(this, args); }
public LoginEventArgs(LoginEventType eventType, ILogin login, OperationContext context) { EventType = eventType; Login = login; Context = context; }
public LoginEvent(LoginEventType eventType) { EventType = eventType; }
public LoginEventArgs(LoginEventType eventType, ILogin login, OperationContext context) { EventType = eventType; Login = login; Context = context; }