Example #1
0
        private string GetContent(UserPasswordChange instance)
        {
            string content = "YKK Portal kullanıcı değişikliğini aşağıdaki adresten yapabilirsiniz. Bilginize;<br><br>";
            var    url     = appConfiguration.GetWebURL();
            var    token   = Cryptology.Encrypt(instance.Id.ToString());

            content = content + string.Format("{0}", url + "ChangePassword?passwordtoken=" + token);
            return(content);
        }
Example #2
0
 private void btnEncrypt_Click(object sender, EventArgs e)
 {
     try
     {
         txtEnc1.Text = Cryptology.Encrypt(txtClear1.Text.Trim());
     }
     catch (Exception ex)
     {
         txtEnc1.Text = "Hata :" + ex.Message;
     }
 }
Example #3
0
        public UserModel Login(LoginUserModel model)
        {
            using (var dbContext = new MissionskyOAEntities())
            {
                string pwd  = Cryptology.Encrypt(model.Password);
                var    user =
                    dbContext.Users.Where(it => it.Email == model.UserName && it.Password == pwd).FirstOrDefault();
                if (user != null)
                {
                    return(user.ToModel());
                }
            }

            return(null);
        }
        public IActionResult ChangePassword(UserForChangePassword userForChangePassword)
        {
            if (userForChangePassword.NewPassword != userForChangePassword.NewPasswordAgain)
            {
                return(RedirectToAction("ChangePassword", new { passwordtoken =
                                                                    Cryptology.Encrypt(userForChangePassword.Id.ToString()) }));
            }

            var changePassword = _userPasswordChangeService.GetById(userForChangePassword.Id);

            changePassword.Date   = DateTime.Now;
            changePassword.Status = true;
            _userPasswordChangeService.Update(changePassword);

            var user = _userService.GetById(changePassword.UserId);

            user.Password = userForChangePassword.NewPassword;
            _userService.Update(user);

            return(RedirectToAction("Login", "Auth"));
        }