示例#1
0
 public void RecordFailedLoginAttempt(LoginModel login, string ipAddress, string reason)
 {
     LoginAttemptLog log = new LoginAttemptLog()
     {
         IpAddress = ipAddress,
         Location = new Location(login.LocationId),
         LoginDate = DateTime.Now,
         Reason = reason,
         ResultFlag = false,
         UserName = login.Name
     };
     SecurityRepository.InsertLoginAttempt(log);
 }
示例#2
0
 public void RecordSuccessfulLoginAttempt(LoginModel login, string ipAddress, string message = null)
 {
     LoginAttemptLog log = new LoginAttemptLog()
     {
         IpAddress = ipAddress,
         Location = new Location(login.LocationId),
         LoginDate = DateTime.Now,
         Reason = string.IsNullOrEmpty(message) ? null : message,
         ResultFlag = true,
         UserName = login.Name
     };
     SecurityRepository.InsertLoginAttempt(log);
 }
 public LoginAttemptLog InsertLoginAttempt(LoginAttemptLog login)
 {
     Session.Save(login);
     return login;
 }