Exemplo n.º 1
0
        /// <summary>
        /// 重写了修改密码的方法,把密码的要求验证给删除了
        /// </summary>
        /// <param name="user"></param>
        /// <param name="newPassword"></param>
        /// <returns></returns>
        public override async Task <IdentityResult> ChangePasswordAsync(User user, string newPassword)
        {
            if (newPassword.IsNullOrWhiteSpace())
            {
                throw new UserFriendlyException("新密码不能为空");
            }
            if (newPassword.Length < 6)
            {
                throw new UserFriendlyException("新密码不能少于6位");
            }
            await AbpUserStore.SetPasswordHashAsync(user, PasswordHasher.HashPassword(user, newPassword));

            return(IdentityResult.Success);
        }
        protected UserOrganizationUnitManager(
            AbpUserStore <TRole, TUser> userStore,
            AbpRoleManager <TRole, TUser> roleManager,
            UserManager userManager,

            IPermissionManager permissionManager,
            IUnitOfWorkManager unitOfWorkManager,
            ICacheManager cacheManager,
            IRepository <OrganizationUnit, long> organizationUnitRepository,
            IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
            IOrganizationUnitSettings organizationUnitSettings,
            ILocalizationManager localizationManager,
            //IdentityEmailMessageService emailService,
            ISettingManager settingManager
            //IUserTokenProviderAccessor userTokenProviderAccessor
            )
        //: base(userStore)
        {
            AbpStore               = userStore;
            RoleManager            = roleManager;
            _userManager           = userManager;
            LocalizationManager    = localizationManager;
            LocalizationSourceName = AbpZeroConsts.LocalizationSourceName;
            _settingManager        = settingManager;

            _permissionManager              = permissionManager;
            _unitOfWorkManager              = unitOfWorkManager;
            _cacheManager                   = cacheManager;
            _organizationUnitRepository     = organizationUnitRepository;
            _userOrganizationUnitRepository = userOrganizationUnitRepository;
            _organizationUnitSettings       = organizationUnitSettings;

            AbpSession = NullAbpSession.Instance;

            //UserLockoutEnabledByDefault = true;
            //DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5);
            //MaxFailedAccessAttemptsBeforeLockout = 5;

            //EmailService = emailService;

            //UserTokenProvider = userTokenProviderAccessor.GetUserTokenProviderOrNull<TUser>();
        }
Exemplo n.º 3
0
 public UserManager(
     AbpRoleManager <Role, User> roleManager,
     AbpUserStore <Role, User> userStore,
     IOptions <IdentityOptions> optionsAccessor,
     IPasswordHasher <User> passwordHasher,
     IEnumerable <IUserValidator <User> > userValidators,
     IEnumerable <IPasswordValidator <User> > passwordValidators,
     ILookupNormalizer keyNormalizer,
     IdentityErrorDescriber errors,
     IServiceProvider services,
     ILogger <UserManager <User> > logger,
     IPermissionManager permissionManager,
     IUnitOfWorkManager unitOfWorkManager,
     ICacheManager cacheManager,
     IRepository <OrganizationUnit, long> organizationUnitRepository,
     IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository,
     IOrganizationUnitSettings organizationUnitSettings,
     ISettingManager settingManager)
     : base(roleManager, userStore, optionsAccessor, passwordHasher, userValidators,
            passwordValidators, keyNormalizer, errors, services, logger, permissionManager,
            unitOfWorkManager, cacheManager, organizationUnitRepository, userOrganizationUnitRepository,
            organizationUnitSettings, settingManager)
 {
 }
Exemplo n.º 4
0
 public UserManager(AbpUserStore <Tenant, Role, User> userStore, AbpRoleManager <Tenant, Role, User> roleManager, IRepository <Tenant> tenantRepository, IMultiTenancyConfig multiTenancyConfig, IPermissionManager permissionManager, IUnitOfWorkManager unitOfWorkManager, ISettingManager settingManager, IUserManagementConfig userManagementConfig, IIocResolver iocResolver, ICacheManager cacheManager) : base(userStore, roleManager, tenantRepository, multiTenancyConfig, permissionManager, unitOfWorkManager, settingManager, userManagementConfig, iocResolver, cacheManager)
 {
 }