Ejemplo n.º 1
0
        public int UpdateUserFailedAttemptCount(BLModel.User user, int numberOfFailedLoginAttempts)
        {
            user.FailedAttemptCount = numberOfFailedLoginAttempts;

            return(_userRepository.Update((DLModel.User) new DLModel.User().InjectFrom(user),
                                          u => u.FailedAttemptCount));
        }
Ejemplo n.º 2
0
 public int ResetUserFailedAttemptCountAndLastLoginDate(BLModel.User user, int failedAttemptCount, DateTime?loginDate)
 {
     user.FailedAttemptCount = failedAttemptCount;
     user.LastLoginDate      = loginDate;
     user.IsLocked           = false;
     return(_userRepository.Update((DLModel.User) new DLModel.User().InjectFrom(user),
                                   u => u.FailedAttemptCount, u => u.LastLoginDate, u => u.IsLocked));
 }
Ejemplo n.º 3
0
        public int UpdateUserFailedAttemptCount(BLModel.User user)
        {
            int numberOfFailedLoginAttempts = user.FailedAttemptCount;

            numberOfFailedLoginAttempts++;

            if (numberOfFailedLoginAttempts >= Global.GlobalConst.AppSetting.FAILEDATTEMPTCOUNT)
            {
                user.FailedAttemptCount = numberOfFailedLoginAttempts;
                return(UpdateUserLock(user, true));
            }
            else
            {
                return(UpdateUserFailedAttemptCount(user, numberOfFailedLoginAttempts));
            }
        }
Ejemplo n.º 4
0
 public int UpdateUser(BLModel.User user)
 {
     return(_userRepository.Update((DLModel.User) new DLModel.User().InjectFrom(user)));
 }
Ejemplo n.º 5
0
 public int AddUser(BLModel.User user)
 {
     return(_userRepository.Add((DLModel.User) new DLModel.User().InjectFrom(user)).UID);
 }
Ejemplo n.º 6
0
 public int UpdateUserLock(BLModel.User user, bool locked)
 {
     user.IsLocked = locked;
     return(_userRepository.Update((DLModel.User) new DLModel.User().InjectFrom(user),
                                   u => u.IsLocked, u => u.FailedAttemptCount));
 }
Ejemplo n.º 7
0
 public int ResetUserFailedAttemptCount(BLModel.User user)
 {
     return(ResetUserFailedAttemptCountAndLastLoginDate(user, 0, System.DateTime.Now));
 }