示例#1
0
        public static int GetPasswordFailuresSinceLastSuccess(string userName)
        {
            CodeFirstExtendedProvider provider = VerifyProvider();

            return(provider.GetPasswordFailuresSinceLastSuccess(userName));
        }
 private static bool IsAccountLockedOutInternal(CodeFirstExtendedProvider provider, string userName, int allowedPasswordAttempts, TimeSpan interval)
 {
     return (provider.GetUser(userName, false) != null && provider.GetPasswordFailuresSinceLastSuccess(userName) > allowedPasswordAttempts && provider.GetLastPasswordFailureDate(userName).Add(interval) > DateTime.UtcNow);
 }
示例#3
0
 private static bool IsAccountLockedOutInternal(CodeFirstExtendedProvider provider, string userName, int allowedPasswordAttempts, TimeSpan interval)
 {
     return(provider.GetUser(userName, false) != null && provider.GetPasswordFailuresSinceLastSuccess(userName) > allowedPasswordAttempts && provider.GetLastPasswordFailureDate(userName).Add(interval) > DateTime.UtcNow);
 }