Exemple #1
0
 public CommentsController(ICommentService comments, IAnimalService animals, IUserService users, ISanitizer sanitizeService)
 {
     this.comments        = comments;
     this.animals         = animals;
     this.users           = users;
     this.sanitizeService = sanitizeService;
 }
 public ChangePhoneCommand(string[] arguments, ISanitizer sanitizer, IPhonebookRepository phonebookDatabase, IPrinter printer)
 {
     this.phonebookDatabase = phonebookDatabase;
     this.sanitizer = sanitizer;
     this.arguments = arguments;
     this.printer = printer;
 }
 public VolunteerFormController(IVolunteerFormService volunteers, IOrganizationService organizations, IAdopterService adopters, ISanitizer sanitizeService)
 {
     this.volunteers = volunteers;
     this.organizations = organizations;
     this.adopters = adopters;
     this.sanitizeService = sanitizeService;
 }
 public CommentsController(ICommentsService comments, IRecipesService recipes, IIdentifierProvider identifierProvider, ISanitizer sanitizer)
 {
     this.comments = comments;
     this.recipes = recipes;
     this.sanitizer = sanitizer;
     this.identifierProvider = identifierProvider;
 }
Exemple #5
0
        public MultimediaService(
            IModelDbFactory modelDbFactory,
            ISanitizer sanitizer,
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Multimedia> multimedia)
        {
            Guard.WhenArgument(
                modelDbFactory,
                GlobalConstants.ModelDbFactoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                sanitizer,
                GlobalConstants.SanitizerRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                multimedia,
                GlobalConstants.MultimediaEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.modelDbFactory = modelDbFactory;
            this.sanitizer      = sanitizer;
            this.mapper         = mapper;
            this.context        = context;
            this.multimedia     = multimedia;
        }
Exemple #6
0
 public AdoptionFormController(IAdoptionFormService adoptionForms, IAnimalService animals, IAdopterService adopters, ISanitizer sanitizeService)
 {
     this.adoptionForms   = adoptionForms;
     this.animals         = animals;
     this.adopters        = adopters;
     this.sanitizeService = sanitizeService;
 }
Exemple #7
0
 public VolunteerFormController(IVolunteerFormService volunteers, IOrganizationService organizations, IAdopterService adopters, ISanitizer sanitizeService)
 {
     this.volunteers      = volunteers;
     this.organizations   = organizations;
     this.adopters        = adopters;
     this.sanitizeService = sanitizeService;
 }
 public AdoptionFormController(IAdoptionFormService adoptionForms, IAnimalService animals, IAdopterService adopters, ISanitizer sanitizeService)
 {
     this.adoptionForms = adoptionForms;
     this.animals = animals;
     this.adopters = adopters;
     this.sanitizeService = sanitizeService;
 }
        public PhotocourseService(
            IModelDbFactory modelDbFactory,
            ISanitizer sanitizer,
            IAutoMapperService mapper,
            IEfDbContextSaveChanges context,
            IPhotoArtSystemEfDbRepository <Photocourse> photocourses)
        {
            Guard.WhenArgument(
                modelDbFactory,
                GlobalConstants.ModelDbFactoryRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                sanitizer,
                GlobalConstants.SanitizerRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                mapper,
                GlobalConstants.AutoMapperServiceRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                context,
                GlobalConstants.EfDbContextRequiredExceptionMessage).IsNull().Throw();
            Guard.WhenArgument(
                photocourses,
                GlobalConstants.PhotocourseEfDbRepositoryRequiredExceptionMessage).IsNull().Throw();

            this.modelDbFactory = modelDbFactory;
            this.sanitizer      = sanitizer;
            this.mapper         = mapper;
            this.context        = context;
            this.photocourses   = photocourses;
        }
Exemple #10
0
 public CommentsController(ICommentsService comments, IRecipesService recipes, IIdentifierProvider identifierProvider, ISanitizer sanitizer)
 {
     this.comments           = comments;
     this.recipes            = recipes;
     this.sanitizer          = sanitizer;
     this.identifierProvider = identifierProvider;
 }
 public CommentsController(ICommentService comments, IAnimalService animals, IUserService users, ISanitizer sanitizeService)
 {
     this.comments = comments;
     this.animals = animals;
     this.users = users;
     this.sanitizeService = sanitizeService;
 }
Exemple #12
0
 public WorkService(IRepository <WorkExperience> workRepo, IRepository <CVAppUser> userRepo, ISanitizer sanitizer, IHttpContextAccessor accessor)
 {
     this.workRepo  = workRepo;
     this.userRepo  = userRepo;
     this.sanitizer = sanitizer;
     this.accessor  = accessor;
     this.resumeId  = this.userRepo.All().SingleOrDefault(u => u.UserName == this.accessor.HttpContext.User.Identity.Name).ResumeId.GetValueOrDefault();
 }
Exemple #13
0
 public PageController(ILikeItData data, IDropDownListPopulator populator, ISanitizer sanitizer, ImageController imageController)
     : base(data)
 {
     this.populator       = populator;
     this.random          = new Random();
     this.sanitizer       = sanitizer;
     this.imageController = imageController;
 }
Exemple #14
0
 public EducationService(IRepository <Education> educationRepo, IRepository <CVAppUser> userRepo, ISanitizer sanitizer, IHttpContextAccessor accessor)
 {
     this.educationRepo = educationRepo;
     this.userRepo      = userRepo;
     this.sanitizer     = sanitizer;
     this.accessor      = accessor;
     this.resumeId      = this.userRepo.All().SingleOrDefault(u => u.UserName == this.accessor.HttpContext.User.Identity.Name).ResumeId.GetValueOrDefault();
 }
 public PageController(ILikeItData data, IDropDownListPopulator populator, ISanitizer sanitizer, ImageController imageController)
     : base(data)
 {
     this.populator = populator;
     this.random = new Random();
     this.sanitizer = sanitizer;
     this.imageController = imageController;
 }
 public void Init()
 {
     this.sanitizeService        = new HtmlSanitizerAdapter();
     this.productsService        = ObjectFactory.GetProductService();
     this.userService            = ObjectFactory.GetUserService();
     this.controller             = new ProductController(this.userService, this.productsService, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public void Init()
 {
     this.sanitizeService = new HtmlSanitizerAdapter();
     this.productsService = ObjectFactory.GetProductService();
     this.userService = ObjectFactory.GetUserService();
     this.controller = new ProductController(this.userService, this.productsService, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public void Init()
 {
     this.sanitizeService        = new HtmlSanitizerAdapter();
     this.articlesService        = ObjectFactory.GetArticleService();
     this.userService            = ObjectFactory.GetUserService();
     this.categories             = ObjectFactory.GetAtricleCategoriesService();
     this.controller             = new ArticleController(this.userService, this.articlesService, this.categories, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public void Init()
 {
     this.sanitizeService = new HtmlSanitizerAdapter();
     this.articlesService = ObjectFactory.GetArticleService();
     this.userService = ObjectFactory.GetUserService();
     this.categories = ObjectFactory.GetAtricleCategoriesService();
     this.controller = new ArticleController(this.userService, this.articlesService, this.categories, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public void Init()
 {
     this.sanitizeService = new HtmlSanitizerAdapter();
     this.commentsService = ObjectFactory.GetCommentService();
     this.userService = ObjectFactory.GetUserService();
     this.model = new AddCommentViewModel();
     this.controller = new CommentController(this.userService, this.commentsService, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public void Init()
 {
     this.sanitizeService        = new HtmlSanitizerAdapter();
     this.commentsService        = ObjectFactory.GetCommentService();
     this.userService            = ObjectFactory.GetUserService();
     this.model                  = new AddCommentViewModel();
     this.controller             = new CommentController(this.userService, this.commentsService, this.sanitizeService);
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
Exemple #22
0
        public Searcher WithSanitizer(ISanitizer sanitizer)
        {
            if (_initialized)
            {
                throw new Exception("ISanitizer cannot be set after initialization");
            }
            TokenSantizer = sanitizer;

            return(this);
        }
Exemple #23
0
 public PersonalInfoService(IRepository <CVAppUser> userRepo, IRepository <Resume> resumeRepo, ISanitizer sanitizer, ICloudinaryService cloudinaryService, IHostingEnvironment environment, IHttpContextAccessor accessor)
 {
     this.userRepo          = userRepo;
     this.resumeRepo        = resumeRepo;
     this.sanitizer         = sanitizer;
     this.cloudinaryService = cloudinaryService;
     this.environment       = environment;
     this.accessor          = accessor;
     this.resumeId          = this.userRepo.All().SingleOrDefault(u => u.UserName == this.accessor.HttpContext.User.Identity.Name).ResumeId.GetValueOrDefault();
 }
Exemple #24
0
 public ForumService(ILogger <ForumService> logger, IRepository <Post> postRepo, IRepository <Comment> commentRepo, IRepository <CakeItUser> userRepo, IRepository <Tag> tagRepo, IRepository <TagPosts> tagPostsRepo, IMapper mapper, ISanitizer sanitizer)
 {
     this.logger       = logger;
     this.postRepo     = postRepo;
     this.commentRepo  = commentRepo;
     this.userRepo     = userRepo;
     this.tagRepo      = tagRepo;
     this.tagPostsRepo = tagPostsRepo;
     this.mapper       = mapper;
     this.sanitizer    = sanitizer;
 }
 public QuestionsController(
     IDeletableEntityRepository <Post> posts,
     IDeletableEntityRepository <Tag> tags,
     IDeletableEntityRepository <Feedback> feedbacks,
     ISanitizer sanitizer)
 {
     this.posts     = posts;
     this.tags      = tags;
     this.feedbacks = feedbacks;
     this.sanitizer = sanitizer;
 }
 public void Init()
 {
     this.sanitizeService = new HtmlSanitizerAdapter();
     this.messageService = ObjectFactory.GetMessageService();
     this.userService = ObjectFactory.GetUserService();
     this.controller = new MessageController(this.userService, this.messageService, this.sanitizeService);
     this.model = new MessageSaveViewModel
     {
         ToUserName = "******",
         ToUserId = "123456"
     };
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public ProductsAdminController(
     IProducerService producers,
     ICommonRepositoryService commons,
     IProductService products,
     ISanitizer sanitizer,
     ICacheService cache)
 {
     this.producers = producers;
     this.commons   = commons;
     this.products  = products;
     this.sanitizer = sanitizer;
     this.cache     = cache;
 }
Exemple #28
0
 public void Init()
 {
     this.sanitizeService = new HtmlSanitizerAdapter();
     this.messageService  = ObjectFactory.GetMessageService();
     this.userService     = ObjectFactory.GetUserService();
     this.controller      = new MessageController(this.userService, this.messageService, this.sanitizeService);
     this.model           = new MessageSaveViewModel
     {
         ToUserName = "******",
         ToUserId   = "123456"
     };
     this.controller.CurrentUser = this.userService.GetUser("test");
 }
 public ProductsAdminController(
     IProducerService producers,
     ICommonRepositoryService commons,
     IProductService products,
     ISanitizer sanitizer,
     ICacheService cache)
 {
     this.producers = producers;
     this.commons = commons;
     this.products = products;
     this.sanitizer = sanitizer;
     this.cache = cache;
 }
Exemple #30
0
        public virtual IRedactorResult Redact(string input)
        {
            IRedactorResult redactorResult = new RedactorResult();

            if (string.IsNullOrWhiteSpace(input))
            {
                redactorResult.Result = input;
                return(redactorResult);
            }

            input = BeforeProcess?.Invoke(input) ?? input;

            ISanitizer sanitizer = CreateSanitizer(input);

            input = sanitizer?.Update(input)?.Sanitize() ?? input;

            IEnumerable <IRedactorMatch> mc = Matcher.Match(input);

            if (mc.Count() > 0)
            {
                foreach (IRedactorMatch m in mc)
                {
                    IRedactorMatch match = BeforeProcessMatch?.Invoke(input, m) ?? m;

                    if (Validator?.Validate(match.Value) ?? true)
                    {
                        input = MatchProcessor.Process(input, match);

                        redactorResult.Logs.Add(new RedactorLogItem()
                        {
                            RangeStart           = match.Index,
                            RangeEnd             = match.Index + match.Length,
                            RedactorFriendlyName = FriendlyName,
                            SanitizedCharacters  = sanitizer?.SanitizedCharacters() ?? Enumerable.Empty <CharacterSnapshot>()
                        });
                    }

                    input = AfterProcessMatch?.Invoke(input, match) ?? input;
                }
            }

            input = sanitizer?.Update(input)?.Desanitize() ?? input;

            input = AfterProcess?.Invoke(input) ?? input;

            redactorResult.Result = input;

            return(redactorResult);
        }
        public ChallengeController(
            IUsersService usersService,
            IChallengesService challengesService,
            ISubmissionsService submissionsService,
            ISanitizer htmlSanitizer)
            : base(usersService)
        {
            Guard.WhenArgument(htmlSanitizer, nameof(htmlSanitizer)).IsNull().Throw();
            Guard.WhenArgument(submissionsService, nameof(submissionsService)).IsNull().Throw();
            Guard.WhenArgument(htmlSanitizer, nameof(htmlSanitizer)).IsNull().Throw();

            this.challenges    = challengesService;
            this.submissions   = submissionsService;
            this.htmlSanitizer = htmlSanitizer;
        }
 public RedirectionService(
     IRedirectSearcher redirectSearcher,
     ISanitizer sanitizer,
     BaseLog logger,
     IUrlMapperContext context,
     BaseLinkManager linkManager,
     BaseMediaManager mediaManager)
 {
     this.redirectSearcher = redirectSearcher;
     this.sanitizer        = sanitizer;
     this.logger           = logger;
     this.context          = context;
     this.linkManager      = linkManager;
     this.mediaManager     = mediaManager;
 }
Exemple #33
0
        protected virtual ISanitizer CreateSanitizer(string input)
        {
            ISanitizer sanitizer = null;

            if (SanitizerType != null)
            {
                sanitizer = SanitizerFactory.GetSanitizer(SanitizerType);

                if (sanitizer is IRedactConfigurable <ISanitizer, ISanitizerOptions> )
                {
                    IRedactConfigurable <ISanitizer, ISanitizerOptions> c = (sanitizer as IRedactConfigurable <ISanitizer, ISanitizerOptions>);

                    if (c.GetConfiguration() == null)
                    {
                        sanitizer = c.Configure(SanitizerOptions);
                    }
                }
            }

            return(sanitizer);
        }
Exemple #34
0
        private async Task <IForumService> Setup(CakeItDbContext db)
        {
            var mockLogger = new Mock <ILogger <ForumService> >();

            this.logger      = mockLogger.Object;
            this.postRepo    = new Repository <Post>(db);
            this.commentRepo = new Repository <Comment>(db);
            this.userRepo    = new Repository <CakeItUser>(db);
            await SeedUsers(userRepo);

            this.tagRepo = new Repository <Tag>(db);
            await SeedTags(tagRepo);

            this.tagPostsRepo = new Repository <TagPosts>(db);
            var mockSanitizer = new Mock <HtmlSanitizerAdapter>();

            this.sanitizer = mockSanitizer.Object;

            var forumService = new ForumService(logger, postRepo, commentRepo, userRepo, tagRepo, tagPostsRepo, this.Mapper, sanitizer);

            return(forumService);
        }
Exemple #35
0
 public KendoGridAdministrationController(IHistoryPortalData data, ISanitizer sanitizer)
     : base(data, sanitizer)
 {
     Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
 }
Exemple #36
0
 public LineParser(ISanitizer sanitizer, IPhonebookRepository phonebookDatabase, IPrinter printer)
 {
     this.factory = new CommandFactory(sanitizer, phonebookDatabase, printer);
 }
 public BaseDetailsListView()
 {
     sanitizer = new HtmlSanitizerAdapter();
 }
 public CommentsController(ICommentService comments, ISanitizer sanitizer)
 {
     this.comments = comments;
     this.sanitizer = sanitizer;
 }
 public AnimalController(IAnimalService animals, IOrganizationService organizations, ISanitizer sanitizeService)
 {
     this.animals = animals;
     this.organizations = organizations;
     this.sanitizeService = sanitizeService;
 }
 public CommentsController(IPackagesService packages, ISanitizer sanitizer)
 {
     this.packages = packages;
     this.sanitizer = sanitizer;
 }
 public ProductController(IUserService usersService, IProductService productsService, ISanitizer sanitizeService)
     :base(usersService, sanitizeService)
 {
     this.productsService = productsService;
 }
 public IngredientsController(IIngredientsService ingredients, ISanitizer sanitizer)
 {
     this.ingredients = ingredients;
     this.sanitizer = sanitizer;
 }
 public PostController(IRepository<Post> posts, ISanitizer sanitizer)
 {
     this.posts = posts;
     this.sanitizer = sanitizer;
 }
Exemple #44
0
 public WriterPostsService(IUnitOfWorkData data, ISanitizer sanitizer)
     : base(data)
 {
     this.sanitizer = sanitizer;
 }
 public ProductViewModel()
 {
     this.sanitaizer = new HtmlSanitizerAdapter();
 }
 public IssuesController(IIssuesService issues, ISanitizer sanitizer)
 {
     this.issues = issues;
     this.sanitizer = sanitizer;
 }
 public QuestionsController(IDeletableEntityRepository<Post> posts, ISanitizer sanitizer)
 {
     this.posts = posts;
     this.sanitizer = sanitizer;
 }
 public CommentsPerAnswerViewModel()
 {
     this.sanitizer = new HtmlSanitizerAdapter();
 }
 public RecipesController(IRecipesService recipes, IOccasionsService occasions, ISanitizer sanitizer)
 {
     this.recipes = recipes;
     this.occasions = occasions;
     this.sanitizer = sanitizer;
 }
 public MessageController(IUserService userService, IMessageService messageService, ISanitizer sanitizeService)
     :base(userService, sanitizeService)
 {
     this.messageService = messageService;
     this.sanitizeService = sanitizeService;
 }
 public FeedbackViewModel()
 {
     this.sanitizer = new HtmlSanitizerAdapter();
 }
 public ArticleController(IUserService usersService, IArticleService articlesService, IAtricleCategoriesService articleCategoriesService, ISanitizer sanitizeService)
     :base(usersService, sanitizeService)
 {
     this.articlesService = articlesService;
     this.articleCategoriesService = articleCategoriesService;
 }
 public FeedbackController(IDeletableEntityRepository<Feedback> feedbacks, ISanitizer sanitizer)
 {
     this.feedbacks = feedbacks;
     this.sanitizer = sanitizer;
 }
 public ChangePhoneCommand(IPrinter printer, IPhonebookRepository repository, ISanitizer sanitizer)
 {
     this.printer = printer;
     this.repository = repository;
     this.sanitizer = sanitizer;
 }
 public CommentsController(IDbRepository <Comment> commentsData, ISanitizer sanitizer)
 {
     this.commentsData = commentsData;
     this.sanitizer    = sanitizer;
 }
 public CommandFactory(ISanitizer sanitizer, IPhonebookRepository phonebookDatabase, IPrinter printer)
 {
     this.sanitizer = sanitizer;
     this.phonebookDatabase = phonebookDatabase;
     this.printer = printer;
 }
 public AnimalController(IAnimalService animals, IOrganizationService organizations, ISanitizer sanitizeService)
 {
     this.animals         = animals;
     this.organizations   = organizations;
     this.sanitizeService = sanitizeService;
 }
 public CommentController(IUserService userService, ICommentService commentsService, ISanitizer sanitizeService)
     :base(userService, sanitizeService)
 {
     this.commentsService = commentsService;
     this.sanitizeService = sanitizeService;
 }
Exemple #59
0
 public ArticlesController(IHistoryPortalData data, ISanitizer sanitizer)
     : base(data, sanitizer)
 {
 }
 public BaseController(IUserService usersService, ISanitizer sanitizeService)
 {
     this.usersService = usersService;
     this.sanitizeService = sanitizeService;
 }