コード例 #1
0
        public bool ChangePassword(ChangePasswordDto changePasswordDto)
        {
            User user = GetLoggedUser();

            if (user == null)
            {
                return(false);
            }
            user.Password = PasswordUtils.ComputeHash(changePasswordDto.NewPassword);
            return(_genericDao.Persist <User>(user) != null);
        }
コード例 #2
0
ファイル: UserCRUDService.cs プロジェクト: MurielSoftware/Bcd
        protected override User CreateEntity(UserDto userDto)
        {
            User user = base.CreateEntity(userDto);

            if (!EntityExists(userDto))
            {
                user.Password = PasswordUtils.ComputeHash(PasswordUtils.CreateRandomPassword());
                user.Order    = _userDao.FindMaxOrderValue() + 1;
            }
            return(user);
        }