Esempio n. 1
0
 private bool ValidateUser(string username, string password)
 {
     Sirloin.Domain.User      result;
     Security.PasswordManager pmanager = new Security.PasswordManager();
     using (var session = DomainAccess.Instance.CurrentSession.OpenSession())
     {
         result = session.Query <Domain.User>().FirstOrDefault <Domain.User>(x => x.Username.ToLower() == username.ToLower());
     }
     if (result != null)
     {
         //user was found
         return(pmanager.IsValidPassword(username, password, result.Password));
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
 private bool ValidateUser(string username, string password)
 {
     Sirloin.Domain.User result;
     Security.PasswordManager pmanager = new Security.PasswordManager();
     using (var session = DomainAccess.Instance.CurrentSession.OpenSession())
     {
         result = session.Query<Domain.User>().FirstOrDefault<Domain.User>(x => x.Username.ToLower() == username.ToLower());
     }
     if (result != null)
     {
         //user was found
         return pmanager.IsValidPassword(username, password, result.Password);
     }
     else
     {
         return false;
     }
 }