Exemplo n.º 1
0
        public static LoginUserStatus ValidateUser(HiMembershipUser user)
        {
            LoginUserStatus result;

            if (user == null)
            {
                result = LoginUserStatus.UnknownError;
            }
            else
            {
                if (!user.IsApproved)
                {
                    result = LoginUserStatus.AccountPending;
                }
                else
                {
                    if (user.IsLockedOut)
                    {
                        result = LoginUserStatus.AccountLockedOut;
                    }
                    else
                    {
                        if (!HiMembership.ValidateUser(user.Username, user.Password))
                        {
                            result = LoginUserStatus.InvalidCredentials;
                        }
                        else
                        {
                            result = LoginUserStatus.Success;
                        }
                    }
                }
            }
            return(result);
        }
Exemplo n.º 2
0
 public static LoginUserStatus ValidateUser(HiMembershipUser user)
 {
     if (user == null)
     {
         return(LoginUserStatus.UnknownError);
     }
     if (!user.IsApproved)
     {
         return(LoginUserStatus.AccountPending);
     }
     if (user.IsLockedOut)
     {
         return(LoginUserStatus.AccountLockedOut);
     }
     if (!HiMembership.ValidateUser(user.Username, user.Password))
     {
         return(LoginUserStatus.InvalidCredentials);
     }
     return(LoginUserStatus.Success);
 }