示例#1
0
        private bool SqlAuthenticateAndLogin(string username, string password)
        {
            var user = sessionFactory().QueryOver <User>()
                       .Where(u => u.Username == username && u.Password == SqlFunnelWebMembership.HashPassword(password))
                       .SingleOrDefault();

            if (user != null)
            {
                FormsAuthentication.SetAuthCookie(username, true);
                return(true);
            }

            return(false);
        }
示例#2
0
        private bool SqlAuthenticateAndLogin(string username, string password)
        {
            var user = sessionFactory()
                       .QueryOver <User>()
                       .Where(u => u.Username == username && u.Password == SqlFunnelWebMembership.HashPassword(password))
                       .SingleOrDefault();

            if (user == null)
            {
                return(false);
            }

            federatedAuthenticationService.Login(user);

            return(true);
        }