Esempio n. 1
0
        internal LocalUserInfoUpdate(Model.LocalUserInfo user, IUserShell shell)
        {
            _shell = shell;
            _user  = user;

            _cache = new ConfigurationCache();
        }
Esempio n. 2
0
        protected void InitializeBase(Model.LocalUserInfo localUserInfo)
        {
            _info    = localUserInfo;
            _shell   = new Lazy <IUserShell>(() => new UserShell());
            _mapper  = new Lazy <UserMapper>(() => new UserMapper());
            _service = new Lazy <ILocalUserInfoUpdate>(
                () => new LocalUserInfoUpdate(localUserInfo, _shell.Value));

            _exceptionFactory =
                new Lazy <IUserExceptionFactory>(
                    () => new WindowsServiceExceptionFactory());
        }
Esempio n. 3
0
        private ConfigurationCache CreateBackupConfig(Model.LocalUserInfo actualUser, ConfigurationCache cache)
        {
            var rollback = new ConfigurationCache();

            if (cache.AccountDisabled.HasValue)
            {
                rollback.AccountDisabled = actualUser.AccountDisabled;
            }

            if (cache.IsVisible.HasValue)
            {
                rollback.IsVisible = actualUser.IsVisible;
            }

            if (cache.PasswordCanBeChangedByUser.HasValue)
            {
                rollback.PasswordCanBeChangedByUser = actualUser.PasswordCanBeChangedByUser;
            }

            if (cache.PasswordRequired.HasValue)
            {
                rollback.PasswordRequired = actualUser.PasswordRequired;
            }

            if (cache.PasswordCanExpire.HasValue)
            {
                rollback.PasswordCanExpire = actualUser.PasswordExpires.HasValue;
            }

            if (cache.PasswordExpired.HasValue)
            {
                rollback.PasswordExpired = actualUser.PasswordExpires.HasValue &&
                                           actualUser.PasswordExpires.Value.Date > DateTime.Now;
            }

            if (cache.Desription != null)
            {
                rollback.Desription = actualUser.Description;
            }

            return(rollback);
        }