Beispiel #1
0
        public bool IsUserExists(string username)
        {
            UsersDAL dal = new UsersDAL();
            bool isExists = false;
            CD_Users user = dal.GetUser(username);

            if (user != null)
            {
                isExists = true;
            }

            return isExists;
        }
Beispiel #2
0
        public long GetUserid(string username, string password)
        {
            UsersDAL dal = new UsersDAL();
            bool isValid = false;
            long lId = 0;
            CD_Users user = dal.GetUser(username);

            if (user != null)
            {
                SaltedHash saltedHash = new SaltedHash();
                isValid = saltedHash.VerifyHashString(password, user.Password, user.Salt);
            }
            if (isValid)
            {
                lId = user.ID;
            }

            return lId;
        }
Beispiel #3
0
        public bool ValidateUser(string username, string password)
        {
            UsersDAL dal = new UsersDAL();
            bool isValid = false;
            CD_Users user = dal.GetUser(username);

            if (user != null)
            {
                SaltedHash saltedHash = new SaltedHash();
                isValid = saltedHash.VerifyHashString(password, user.Password, user.Salt);
            }

            return isValid;
        }