예제 #1
0
        public void ChangePassword(int id, string password)
        {
            var user = GetByID(id);

            user.Password = EncriptServise.EncryptData(password);
            Save(user);
        }
예제 #2
0
        public SingIn ResetPassword(List <SingIn> users, string email)
        {
            string decriptedEmail;

            for (int i = 0; i < users.Count; i++)
            {
                decriptedEmail = EncriptServise.DencryptData(users[i].Email);
                if (email == decriptedEmail)
                {
                    return(users[i]);
                }
            }
            return(null);
        }
예제 #3
0
        public List <string> AutoLogin()
        {
            List <string> loginInfo = new List <string>();

            HttpCookie cookie = HttpContext.Current.Request.Cookies["UserInformation"];

            try
            {
                loginInfo.Add(EncriptServise.DencryptData(cookie["username"]));
                loginInfo.Add(EncriptServise.DencryptData(cookie["password"]));
            }
            catch (NullReferenceException)
            {
            }
            return(loginInfo);
        }