Example #1
0
 public CaptchaTagHelper(CaptchaSettings captchaSettings, IWorkContext workContext, SmartConfiguration appConfig)
 {
     _captchaSettings = captchaSettings;
     _workContext     = workContext;
     _appConfig       = appConfig;
 }
 public CustomerModelFactory(IAddressModelFactory addressModelFactory,
                             IDateTimeHelper dateTimeHelper,
                             DateTimeSettings dateTimeSettings,
                             TaxSettings taxSettings,
                             ILocalizationService localizationService,
                             IWorkContext workContext,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IGenericAttributeService genericAttributeService,
                             RewardPointsSettings rewardPointsSettings,
                             CustomerSettings customerSettings,
                             AddressSettings addressSettings,
                             ForumSettings forumSettings,
                             OrderSettings orderSettings,
                             ICountryService countryService,
                             IStateProvinceService stateProvinceService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOpenAuthenticationService openAuthenticationService,
                             IDownloadService downloadService,
                             IReturnRequestService returnRequestService,
                             MediaSettings mediaSettings,
                             CaptchaSettings captchaSettings,
                             SecuritySettings securitySettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             CatalogSettings catalogSettings,
                             VendorSettings vendorSettings)
 {
     this._addressModelFactory            = addressModelFactory;
     this._dateTimeHelper                 = dateTimeHelper;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._localizationService            = localizationService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._storeMappingService            = storeMappingService;
     this._customerAttributeParser        = customerAttributeParser;
     this._customerAttributeService       = customerAttributeService;
     this._genericAttributeService        = genericAttributeService;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._customerSettings               = customerSettings;
     this._addressSettings                = addressSettings;
     this._forumSettings                  = forumSettings;
     this._orderSettings                  = orderSettings;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._orderService                   = orderService;
     this._pictureService                 = pictureService;
     this._newsLetterSubscriptionService  = newsLetterSubscriptionService;
     this._openAuthenticationService      = openAuthenticationService;
     this._downloadService                = downloadService;
     this._returnRequestService           = returnRequestService;
     this._mediaSettings                  = mediaSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._catalogSettings                = catalogSettings;
     this._vendorSettings                 = vendorSettings;
 }
 public CustomerModelFactory(AddressSettings addressSettings,
                             CaptchaSettings captchaSettings,
                             CatalogSettings catalogSettings,
                             CommonSettings commonSettings,
                             CustomerSettings customerSettings,
                             DateTimeSettings dateTimeSettings,
                             ExternalAuthenticationSettings externalAuthenticationSettings,
                             ForumSettings forumSettings,
                             GdprSettings gdprSettings,
                             IAddressModelFactory addressModelFactory,
                             IAuthenticationPluginManager authenticationPluginManager,
                             ICountryService countryService,
                             ICustomerAttributeParser customerAttributeParser,
                             ICustomerAttributeService customerAttributeService,
                             IDateTimeHelper dateTimeHelper,
                             IDownloadService downloadService,
                             IGdprService gdprService,
                             IGenericAttributeService genericAttributeService,
                             ILocalizationService localizationService,
                             INewsLetterSubscriptionService newsLetterSubscriptionService,
                             IOrderService orderService,
                             IPictureService pictureService,
                             IReturnRequestService returnRequestService,
                             IStateProvinceService stateProvinceService,
                             IStoreContext storeContext,
                             IStoreMappingService storeMappingService,
                             IUrlRecordService urlRecordService,
                             IWorkContext workContext,
                             MediaSettings mediaSettings,
                             OrderSettings orderSettings,
                             RewardPointsSettings rewardPointsSettings,
                             SecuritySettings securitySettings,
                             TaxSettings taxSettings,
                             VendorSettings vendorSettings)
 {
     _addressSettings  = addressSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _dateTimeSettings = dateTimeSettings;
     _externalAuthenticationSettings = externalAuthenticationSettings;
     _forumSettings               = forumSettings;
     _gdprSettings                = gdprSettings;
     _addressModelFactory         = addressModelFactory;
     _authenticationPluginManager = authenticationPluginManager;
     _countryService              = countryService;
     _customerAttributeParser     = customerAttributeParser;
     _customerAttributeService    = customerAttributeService;
     _dateTimeHelper              = dateTimeHelper;
     _downloadService             = downloadService;
     _gdprService                   = gdprService;
     _genericAttributeService       = genericAttributeService;
     _localizationService           = localizationService;
     _newsLetterSubscriptionService = newsLetterSubscriptionService;
     _orderService                  = orderService;
     _pictureService                = pictureService;
     _returnRequestService          = returnRequestService;
     _stateProvinceService          = stateProvinceService;
     _storeContext                  = storeContext;
     _storeMappingService           = storeMappingService;
     _urlRecordService              = urlRecordService;
     _workContext                   = workContext;
     _mediaSettings                 = mediaSettings;
     _orderSettings                 = orderSettings;
     _rewardPointsSettings          = rewardPointsSettings;
     _securitySettings              = securitySettings;
     _taxSettings                   = taxSettings;
     _vendorSettings                = vendorSettings;
 }
Example #4
0
        /// <summary>
        /// Generate reCAPTCHA Control
        /// </summary>
        /// <param name="helper">HTML helper</param>
        /// <param name="captchaSettings">Captcha settings</param>
        /// <returns>Result</returns>
        public static IHtmlContent GenerateCheckBoxReCaptchaV2(this IHtmlHelper helper, CaptchaSettings captchaSettings)
        {
            //prepare language
            var language = GetReCaptchaLanguage(captchaSettings);

            //prepare theme
            var theme = (captchaSettings.ReCaptchaTheme ?? string.Empty).ToLower();

            switch (theme)
            {
            case "blackglass":
            case "dark":
                theme = "dark";
                break;

            case "clean":
            case "red":
            case "white":
            case "light":
            default:
                theme = "light";
                break;
            }

            //prepare identifier
            var id = $"captcha_{CommonHelper.GenerateRandomInteger()}";

            //prepare public key
            var publicKey = captchaSettings.ReCaptchaPublicKey ?? string.Empty;

            //generate reCAPTCHA Control
            var scriptCallbackTag = new TagBuilder("script")
            {
                TagRenderMode = TagRenderMode.Normal
            };

            scriptCallbackTag.InnerHtml
            .AppendHtml($"var onloadCallback{id} = function() {{grecaptcha.render('{id}', {{'sitekey' : '{publicKey}', 'theme' : '{theme}' }});}};");

            var captchaTag = new TagBuilder("div")
            {
                TagRenderMode = TagRenderMode.Normal
            };

            captchaTag.Attributes.Add("id", id);

            var scriptLoadApiTag = GenerateLoadApiScriptTag(captchaSettings, id, "explicit", language);

            return(new HtmlString(scriptCallbackTag.RenderHtmlContent() + captchaTag.RenderHtmlContent() + scriptLoadApiTag.RenderHtmlContent()));
        }
        public CommonModelFactory(ICategoryService categoryService,
                                  IProductService productService,
                                  IManufacturerService manufacturerService,
                                  ITopicService topicService,
                                  ILanguageService languageService,
                                  ICurrencyService currencyService,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  IStoreContext storeContext,
                                  ISitemapGenerator sitemapGenerator,
                                  IThemeContext themeContext,
                                  IThemeProvider themeProvider,
                                  IForumService forumService,
                                  IGenericAttributeService genericAttributeService,
                                  IWebHelper webHelper,
                                  IPermissionService permissionService,
                                  ICacheManager cacheManager,
                                  IPageHeadBuilder pageHeadBuilder,
                                  IPictureService pictureService,
                                  HttpContextBase httpContext,
                                  CatalogSettings catalogSettings,
                                  StoreInformationSettings storeInformationSettings,
                                  CommonSettings commonSettings,
                                  BlogSettings blogSettings,
                                  NewsSettings newsSettings,
                                  ForumSettings forumSettings,
                                  LocalizationSettings localizationSettings,
                                  CaptchaSettings captchaSettings,
                                  VendorSettings vendorSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper         = webHelper;
            this._permissionService = permissionService;
            this._cacheManager      = cacheManager;
            this._pageHeadBuilder   = pageHeadBuilder;
            this._pictureService    = pictureService;
            this._httpContext       = httpContext;

            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._vendorSettings           = vendorSettings;
        }
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           IBlogService blogService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHttpContextAccessor httpContextAccessor,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INewsService newsService,
                           IQNetFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           IShoppingCartService shoppingCartService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager cacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           MediaSettings mediaSettings,
                           NewsSettings newsSettings,
                           SitemapSettings sitemapSettings,
                           SitemapXmlSettings sitemapXmlSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     _blogSettings     = blogSettings;
     _captchaSettings  = captchaSettings;
     _catalogSettings  = catalogSettings;
     _commonSettings   = commonSettings;
     _customerSettings = customerSettings;
     _displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     _forumSettings           = forumSettings;
     _actionContextAccessor   = actionContextAccessor;
     _blogService             = blogService;
     _categoryService         = categoryService;
     _currencyService         = currencyService;
     _customerService         = customerService;
     _forumService            = forumService;
     _genericAttributeService = genericAttributeService;
     _httpContextAccessor     = httpContextAccessor;
     _languageService         = languageService;
     _localizationService     = localizationService;
     _manufacturerService     = manufacturerService;
     _newsService             = newsService;
     _fileProvider            = fileProvider;
     _pageHeadBuilder         = pageHeadBuilder;
     _permissionService       = permissionService;
     _pictureService          = pictureService;
     _productService          = productService;
     _productTagService       = productTagService;
     _shoppingCartService     = shoppingCartService;
     _sitemapGenerator        = sitemapGenerator;
     _cacheManager            = cacheManager;
     _storeContext            = storeContext;
     _themeContext            = themeContext;
     _themeProvider           = themeProvider;
     _topicService            = topicService;
     _urlHelperFactory        = urlHelperFactory;
     _urlRecordService        = urlRecordService;
     _webHelper                = webHelper;
     _workContext              = workContext;
     _mediaSettings            = mediaSettings;
     _localizationSettings     = localizationSettings;
     _newsSettings             = newsSettings;
     _sitemapSettings          = sitemapSettings;
     _sitemapXmlSettings       = sitemapXmlSettings;
     _storeInformationSettings = storeInformationSettings;
     _vendorSettings           = vendorSettings;
 }
Example #7
0
        public CommonController(ICategoryService categoryService,
                                IProductService productService,
                                IManufacturerService manufacturerService,
                                ITopicService topicService,
                                ILanguageService languageService,
                                ICurrencyService currencyService,
                                ILocalizationService localizationService,
                                IWorkContext workContext,
                                IStoreContext storeContext,
                                IQueuedEmailService queuedEmailService,
                                IEmailAccountService emailAccountService,
                                ISitemapGenerator sitemapGenerator,
                                IThemeContext themeContext,
                                IThemeProvider themeProvider,
                                IForumService forumService,
                                IGenericAttributeService genericAttributeService,
                                IWebHelper webHelper,
                                IPermissionService permissionService,
                                ICacheManager cacheManager,
                                ICustomerActivityService customerActivityService,
                                IVendorService vendorService,
                                IPageHeadBuilder pageHeadBuilder,
                                IPictureService pictureService,
                                CustomerSettings customerSettings,
                                TaxSettings taxSettings,
                                CatalogSettings catalogSettings,
                                StoreInformationSettings storeInformationSettings,
                                EmailAccountSettings emailAccountSettings,
                                CommonSettings commonSettings,
                                BlogSettings blogSettings,
                                NewsSettings newsSettings,
                                ForumSettings forumSettings,
                                LocalizationSettings localizationSettings,
                                CaptchaSettings captchaSettings,
                                VendorSettings vendorSettings)
        {
            this._categoryService         = categoryService;
            this._productService          = productService;
            this._manufacturerService     = manufacturerService;
            this._topicService            = topicService;
            this._languageService         = languageService;
            this._currencyService         = currencyService;
            this._localizationService     = localizationService;
            this._workContext             = workContext;
            this._storeContext            = storeContext;
            this._queuedEmailService      = queuedEmailService;
            this._emailAccountService     = emailAccountService;
            this._sitemapGenerator        = sitemapGenerator;
            this._themeContext            = themeContext;
            this._themeProvider           = themeProvider;
            this._forumservice            = forumService;
            this._genericAttributeService = genericAttributeService;
            this._webHelper               = webHelper;
            this._permissionService       = permissionService;
            this._cacheManager            = cacheManager;
            this._customerActivityService = customerActivityService;
            this._vendorService           = vendorService;
            this._pageHeadBuilder         = pageHeadBuilder;
            this._pictureService          = pictureService;


            this._customerSettings         = customerSettings;
            this._taxSettings              = taxSettings;
            this._catalogSettings          = catalogSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._emailAccountSettings     = emailAccountSettings;
            this._commonSettings           = commonSettings;
            this._blogSettings             = blogSettings;
            this._newsSettings             = newsSettings;
            this._forumSettings            = forumSettings;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._vendorSettings           = vendorSettings;
        }
 public static CaptchaSettings ToEntity(this GeneralCommonSettingsModel.CaptchaSettingsModel model, CaptchaSettings destination)
 {
     return(model.MapTo(destination));
 }
Example #9
0
 public GBSProductModelFactory(IPluginFinder pluginFinder,
                               IHttpContextAccessor httpContextAccessor,
                               ISpecificationAttributeService specificationAttributeService,
                               ICategoryService categoryService,
                               IManufacturerService manufacturerService,
                               IProductService productService,
                               IVendorService vendorService,
                               IProductTemplateService productTemplateService,
                               IProductAttributeService productAttributeService,
                               IWorkContext workContext,
                               IStoreContext storeContext,
                               ITaxService taxService,
                               ICurrencyService currencyService,
                               IPictureService pictureService,
                               ILocalizationService localizationService,
                               IMeasureService measureService,
                               IPriceCalculationService priceCalculationService,
                               IPriceFormatter priceFormatter,
                               IWebHelper webHelper,
                               IDateTimeHelper dateTimeHelper,
                               IProductTagService productTagService,
                               IAclService aclService,
                               IStoreMappingService storeMappingService,
                               IPermissionService permissionService,
                               IDownloadService downloadService,
                               IProductAttributeParser productAttributeParser,
                               IDateRangeService dateRangeService,
                               MediaSettings mediaSettings,
                               CatalogSettings catalogSettings,
                               VendorSettings vendorSettings,
                               CustomerSettings customerSettings,
                               CaptchaSettings captchaSettings,
                               OrderSettings orderSettings,
                               SeoSettings seoSettings,
                               IStaticCacheManager cacheManager) :
     base(specificationAttributeService,
          categoryService,
          manufacturerService,
          productService,
          vendorService,
          productTemplateService,
          productAttributeService,
          workContext,
          storeContext,
          taxService,
          currencyService,
          pictureService,
          localizationService,
          measureService,
          priceCalculationService,
          priceFormatter,
          webHelper,
          dateTimeHelper,
          productTagService,
          aclService,
          storeMappingService,
          permissionService,
          downloadService,
          productAttributeParser,
          dateRangeService,
          mediaSettings,
          catalogSettings,
          vendorSettings,
          customerSettings,
          captchaSettings,
          orderSettings,
          seoSettings,
          cacheManager)
 {
     _workContext         = workContext;
     _storeContext        = storeContext;
     _cacheManager        = cacheManager;
     _catalogSettings     = catalogSettings;
     _categoryService     = categoryService;
     _aclService          = aclService;
     _storeMappingService = storeMappingService;
     _pluginFinder        = pluginFinder;
     _httpContextAccessor = httpContextAccessor;
 }
 public OverriddenShoppingCartModelFactory(AddressSettings addressSettings,
                                           CaptchaSettings captchaSettings,
                                           CatalogSettings catalogSettings,
                                           CommonSettings commonSettings,
                                           CustomerSettings customerSettings,
                                           IAddressService addressService,
                                           IAddressModelFactory addressModelFactory,
                                           ICheckoutAttributeFormatter checkoutAttributeFormatter,
                                           ICheckoutAttributeParser checkoutAttributeParser,
                                           ICheckoutAttributeService checkoutAttributeService,
                                           ICountryService countryService,
                                           ICurrencyService currencyService,
                                           ICustomerService customerService,
                                           IDateTimeHelper dateTimeHelper,
                                           IDiscountService discountService,
                                           IDownloadService downloadService,
                                           IGenericAttributeService genericAttributeService,
                                           IGiftCardService giftCardService,
                                           IHttpContextAccessor httpContextAccessor,
                                           ILocalizationService localizationService,
                                           IOrderProcessingService orderProcessingService,
                                           IOrderTotalCalculationService orderTotalCalculationService,
                                           IPaymentPluginManager paymentPluginManager,
                                           IPaymentService paymentService,
                                           IPermissionService permissionService,
                                           IPictureService pictureService,
                                           IPriceFormatter priceFormatter,
                                           IProductAttributeFormatter productAttributeFormatter,
                                           IProductService productService,
                                           IShippingPluginManager shippingPluginManager,
                                           IShippingService shippingService,
                                           IShoppingCartService shoppingCartService,
                                           IStateProvinceService stateProvinceService,
                                           IStaticCacheManager cacheManager,
                                           IStoreContext storeContext,
                                           ITaxPluginManager taxPluginManager,
                                           ITaxService taxService,
                                           IUrlRecordService urlRecordService,
                                           IVendorService vendorService,
                                           IWebHelper webHelper,
                                           IWorkContext workContext,
                                           MediaSettings mediaSettings,
                                           OrderSettings orderSettings,
                                           RewardPointsSettings rewardPointsSettings,
                                           ShippingSettings shippingSettings,
                                           ShoppingCartSettings shoppingCartSettings,
                                           TaxSettings taxSettings,
                                           VendorSettings vendorSettings) : base(addressSettings,
                                                                                 captchaSettings,
                                                                                 catalogSettings,
                                                                                 commonSettings,
                                                                                 customerSettings,
                                                                                 addressModelFactory,
                                                                                 checkoutAttributeFormatter,
                                                                                 checkoutAttributeParser,
                                                                                 checkoutAttributeService,
                                                                                 countryService,
                                                                                 currencyService,
                                                                                 customerService,
                                                                                 dateTimeHelper,
                                                                                 discountService,
                                                                                 downloadService,
                                                                                 genericAttributeService,
                                                                                 giftCardService,
                                                                                 httpContextAccessor,
                                                                                 localizationService,
                                                                                 orderProcessingService,
                                                                                 orderTotalCalculationService,
                                                                                 paymentPluginManager,
                                                                                 paymentService,
                                                                                 permissionService,
                                                                                 pictureService,
                                                                                 priceFormatter,
                                                                                 productAttributeFormatter,
                                                                                 productService,
                                                                                 shippingPluginManager,
                                                                                 shippingService,
                                                                                 shoppingCartService,
                                                                                 stateProvinceService,
                                                                                 cacheManager,
                                                                                 storeContext,
                                                                                 taxService,
                                                                                 urlRecordService,
                                                                                 vendorService,
                                                                                 webHelper,
                                                                                 workContext,
                                                                                 mediaSettings,
                                                                                 orderSettings,
                                                                                 rewardPointsSettings,
                                                                                 shippingSettings,
                                                                                 shoppingCartSettings,
                                                                                 taxSettings,
                                                                                 vendorSettings)
 {
     _addressService               = addressService;
     _countryService               = countryService;
     _currencyService              = currencyService;
     _genericAttributeService      = genericAttributeService;
     _giftCardService              = giftCardService;
     _httpContextAccessor          = httpContextAccessor;
     _orderTotalCalculationService = orderTotalCalculationService;
     _paymentService               = paymentService;
     _priceFormatter               = priceFormatter;
     _productService               = productService;
     _shippingPluginManager        = shippingPluginManager;
     _shoppingCartService          = shoppingCartService;
     _stateProvinceService         = stateProvinceService;
     _storeContext         = storeContext;
     _taxPluginManager     = taxPluginManager;
     _taxService           = taxService;
     _workContext          = workContext;
     _rewardPointsSettings = rewardPointsSettings;
     _shippingSettings     = shippingSettings;
     _taxSettings          = taxSettings;
 }
 //general (captcha) settings
 public static GeneralCommonSettingsModel.CaptchaSettingsModel ToModel(this CaptchaSettings entity)
 {
     return(entity.MapTo <CaptchaSettings, GeneralCommonSettingsModel.CaptchaSettingsModel>());
 }
 public GetProductAskQuestionHandler(CaptchaSettings captchaSettings)
 {
     _captchaSettings = captchaSettings;
 }
 public ProductModelFactoryCustom(CaptchaSettings captchaSettings,
                                  CatalogSettings catalogSettings,
                                  CustomerSettings customerSettings,
                                  ICategoryService categoryService,
                                  ICurrencyService currencyService,
                                  ICustomerService customerService,
                                  IDateRangeService dateRangeService,
                                  IDateTimeHelper dateTimeHelper,
                                  IDownloadService downloadService,
                                  ILocalizationService localizationService,
                                  IManufacturerService manufacturerService,
                                  IPermissionService permissionService,
                                  IPictureService pictureService,
                                  IPriceCalculationService priceCalculationService,
                                  IPriceFormatter priceFormatter,
                                  IProductAttributeParser productAttributeParser,
                                  IProductAttributeService productAttributeService,
                                  IProductService productService,
                                  IProductTagService productTagService,
                                  IProductTemplateService productTemplateService,
                                  IReviewTypeService reviewTypeService,
                                  ISpecificationAttributeService specificationAttributeService,
                                  IStaticCacheManager cacheManager,
                                  IStoreContext storeContext,
                                  ITaxService taxService,
                                  IUrlRecordService urlRecordService,
                                  IVendorService vendorService,
                                  IWebHelper webHelper,
                                  IWorkContext workContext,
                                  MediaSettings mediaSettings,
                                  OrderSettings orderSettings,
                                  SeoSettings seoSettings,
                                  VendorSettings vendorSettings)
     : base(captchaSettings, catalogSettings, customerSettings, categoryService, currencyService, customerService, dateRangeService, dateTimeHelper,
            downloadService, localizationService, manufacturerService, permissionService, pictureService, priceCalculationService, priceFormatter,
            productAttributeParser, productAttributeService, productService, productTagService, productTemplateService, reviewTypeService, specificationAttributeService,
            cacheManager, storeContext, taxService, urlRecordService, vendorService, webHelper, workContext, mediaSettings, orderSettings, seoSettings, vendorSettings)
 {
     this._captchaSettings               = captchaSettings;
     this._catalogSettings               = catalogSettings;
     this._customerSettings              = customerSettings;
     this._categoryService               = categoryService;
     this._currencyService               = currencyService;
     this._customerService               = customerService;
     this._dateRangeService              = dateRangeService;
     this._dateTimeHelper                = dateTimeHelper;
     this._downloadService               = downloadService;
     this._localizationService           = localizationService;
     this._manufacturerService           = manufacturerService;
     this._permissionService             = permissionService;
     this._pictureService                = pictureService;
     this._priceCalculationService       = priceCalculationService;
     this._priceFormatter                = priceFormatter;
     this._productAttributeParser        = productAttributeParser;
     this._productAttributeService       = productAttributeService;
     this._productService                = productService;
     this._productTagService             = productTagService;
     this._productTemplateService        = productTemplateService;
     this._reviewTypeService             = reviewTypeService;
     this._specificationAttributeService = specificationAttributeService;
     this._cacheManager     = cacheManager;
     this._storeContext     = storeContext;
     this._taxService       = taxService;
     this._urlRecordService = urlRecordService;
     this._vendorService    = vendorService;
     this._webHelper        = webHelper;
     this._workContext      = workContext;
     this._mediaSettings    = mediaSettings;
     this._orderSettings    = orderSettings;
     this._seoSettings      = seoSettings;
     this._vendorSettings   = vendorSettings;
 }
        public VendorController(IVendorModelFactory vendorModelFactory, IWorkContext workContext, ILocalizationService localizationService,
                                ICustomerService customerService, IWorkflowMessageService workflowMessageService, IVendorService vendorService,
                                IUrlRecordService urlRecordService, IPictureService pictureService,
                                LocalizationSettings localizationSettings, VendorSettings vendorSettings, CaptchaSettings captchaSettings,
                                ICountryService countryService, ICategoryService categoryService, ICatalogModelFactory catalogModelFactory)
            : base(vendorModelFactory, workContext, localizationService, customerService, workflowMessageService, vendorService,
                   urlRecordService, pictureService,
                   localizationSettings, vendorSettings, captchaSettings)
        {
            _vendorModelFactory     = vendorModelFactory;
            _workContext            = workContext;
            _localizationService    = localizationService;
            _customerService        = customerService;
            _workflowMessageService = workflowMessageService;
            _vendorService          = vendorService;
            _urlRecordService       = urlRecordService;
            _pictureService         = pictureService;

            _localizationSettings = localizationSettings;
            _vendorSettings       = vendorSettings;
            _captchaSettings      = captchaSettings;

            _countryService      = countryService;
            _categoryService     = categoryService;
            _catalogModelFactory = catalogModelFactory;
        }
Example #15
0
 public CustomerViewModelService(
     IExternalAuthenticationService externalAuthenticationService,
     ICustomerAttributeParser customerAttributeParser,
     ICustomerAttributeService customerAttributeService,
     ILocalizationService localizationService,
     IDateTimeHelper dateTimeHelper,
     INewsLetterSubscriptionService newsLetterSubscriptionService,
     IWorkContext workContext,
     IStoreContext storeContext,
     ICountryService countryService,
     IStateProvinceService stateProvinceService,
     IGenericAttributeService genericAttributeService,
     IWorkflowMessageService workflowMessageService,
     IReturnRequestService returnRequestService,
     IStoreMappingService storeMappingService,
     IAddressViewModelService addressViewModelService,
     IOrderService orderService,
     IDownloadService downloadService,
     IPictureService pictureService,
     IProductService productService,
     IAuctionService auctionService,
     INewsletterCategoryService newsletterCategoryService,
     IServiceProvider serviceProvider,
     CustomerSettings customerSettings,
     DateTimeSettings dateTimeSettings,
     TaxSettings taxSettings,
     ForumSettings forumSettings,
     ExternalAuthenticationSettings externalAuthenticationSettings,
     SecuritySettings securitySettings,
     CaptchaSettings captchaSettings,
     RewardPointsSettings rewardPointsSettings,
     OrderSettings orderSettings,
     MediaSettings mediaSettings,
     VendorSettings vendorSettings
     )
 {
     this._externalAuthenticationService = externalAuthenticationService;
     this._customerAttributeParser       = customerAttributeParser;
     this._customerAttributeService      = customerAttributeService;
     this._localizationService           = localizationService;
     this._dateTimeHelper = dateTimeHelper;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._workContext                    = workContext;
     this._storeContext                   = storeContext;
     this._countryService                 = countryService;
     this._stateProvinceService           = stateProvinceService;
     this._genericAttributeService        = genericAttributeService;
     this._workflowMessageService         = workflowMessageService;
     this._returnRequestService           = returnRequestService;
     this._storeMappingService            = storeMappingService;
     this._addressViewModelService        = addressViewModelService;
     this._orderService                   = orderService;
     this._downloadService                = downloadService;
     this._pictureService                 = pictureService;
     this._productService                 = productService;
     this._auctionService                 = auctionService;
     this._newsletterCategoryService      = newsletterCategoryService;
     this._serviceProvider                = serviceProvider;
     this._customerSettings               = customerSettings;
     this._dateTimeSettings               = dateTimeSettings;
     this._taxSettings                    = taxSettings;
     this._forumSettings                  = forumSettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._securitySettings               = securitySettings;
     this._captchaSettings                = captchaSettings;
     this._rewardPointsSettings           = rewardPointsSettings;
     this._orderSettings                  = orderSettings;
     this._mediaSettings                  = mediaSettings;
     this._vendorSettings                 = vendorSettings;
 }
        public ShoppingCartModelExtension(
            IShoppingCartModelFactory shoppingCartModelFactory,
            IPluginFinder pluginFinder,
            IProductService productService,
            IStoreContext storeContext,
            IWorkContext workContext,
            IShoppingCartService shoppingCartService,
            IPictureService pictureService,
            ILocalizationService localizationService,
            IProductAttributeService productAttributeService,
            IProductAttributeFormatter productAttributeFormatter,
            IProductAttributeParser productAttributeParser,
            ITaxService taxService, ICurrencyService currencyService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            ICheckoutAttributeParser checkoutAttributeParser,
            ICheckoutAttributeFormatter checkoutAttributeFormatter,
            IOrderProcessingService orderProcessingService,
            IDiscountService discountService,
            ICustomerService customerService,
            IGiftCardService giftCardService,
            IDateRangeService dateRangeService,
            ICountryService countryService,
            IStateProvinceService stateProvinceService,
            IShippingService shippingService,
            IOrderTotalCalculationService orderTotalCalculationService,
            ICheckoutAttributeService checkoutAttributeService,
            IPaymentService paymentService,
            IWorkflowMessageService workflowMessageService,
            IPermissionService permissionService,
            IDownloadService downloadService,
            IStaticCacheManager cacheManager,
            IWebHelper webHelper,
            ICustomerActivityService customerActivityService,
            IGenericAttributeService genericAttributeService,
            IAddressAttributeFormatter addressAttributeFormatter,
            MediaSettings mediaSettings,
            ShoppingCartSettings shoppingCartSettings,
            CatalogSettings catalogSettings,
            OrderSettings orderSettings,
            ShippingSettings shippingSettings,
            TaxSettings taxSettings,
            CaptchaSettings captchaSettings,
            AddressSettings addressSettings,
            RewardPointsSettings rewardPointsSettings,
            CustomerSettings customerSettings) : base(
                shoppingCartModelFactory,
                productService,
                storeContext,
                workContext,
                shoppingCartService,
                pictureService,
                localizationService,
                productAttributeService,
                productAttributeParser,
                taxService,
                currencyService,
                priceCalculationService,
                priceFormatter,
                checkoutAttributeParser,
                discountService,
                customerService,
                giftCardService,
                dateRangeService,
                checkoutAttributeService,
                workflowMessageService,
                permissionService,
                downloadService,
                cacheManager,
                webHelper,
                customerActivityService,
                genericAttributeService,
                mediaSettings,
                shoppingCartSettings,
                orderSettings,
                captchaSettings,
                customerSettings
                )
        {
            this._productService            = productService;
            this._workContext               = workContext;
            this._storeContext              = storeContext;
            this._shoppingCartService       = shoppingCartService;
            this._pictureService            = pictureService;
            this._localizationService       = localizationService;
            this._productAttributeService   = productAttributeService;
            this._productAttributeFormatter = productAttributeFormatter;
            this._productAttributeParser    = productAttributeParser;
            this._taxService                   = taxService;
            this._currencyService              = currencyService;
            this._priceCalculationService      = priceCalculationService;
            this._priceFormatter               = priceFormatter;
            this._checkoutAttributeParser      = checkoutAttributeParser;
            this._checkoutAttributeFormatter   = checkoutAttributeFormatter;
            this._orderProcessingService       = orderProcessingService;
            this._discountService              = discountService;
            this._customerService              = customerService;
            this._giftCardService              = giftCardService;
            this._countryService               = countryService;
            this._stateProvinceService         = stateProvinceService;
            this._shippingService              = shippingService;
            this._orderTotalCalculationService = orderTotalCalculationService;
            this._checkoutAttributeService     = checkoutAttributeService;
            this._paymentService               = paymentService;
            this._workflowMessageService       = workflowMessageService;
            this._permissionService            = permissionService;
            this._downloadService              = downloadService;
            this._cacheManager                 = cacheManager;
            this._webHelper = webHelper;
            this._customerActivityService   = customerActivityService;
            this._genericAttributeService   = genericAttributeService;
            this._addressAttributeFormatter = addressAttributeFormatter;

            this._mediaSettings            = mediaSettings;
            this._shoppingCartSettings     = shoppingCartSettings;
            this._catalogSettings          = catalogSettings;
            this._orderSettings            = orderSettings;
            this._shippingSettings         = shippingSettings;
            this._taxSettings              = taxSettings;
            this._captchaSettings          = captchaSettings;
            this._addressSettings          = addressSettings;
            this._rewardPointsSettings     = rewardPointsSettings;
            this._customerSettings         = customerSettings;
            this._shoppingCartModelFactory = shoppingCartModelFactory;
        }
Example #17
0
 public ContactUsCommandHandler(IContactAttributeService contactAttributeService, CommonSettings commonSettings, CaptchaSettings captchaSettings)
 {
     _contactAttributeService = contactAttributeService;
     _commonSettings          = commonSettings;
     _captchaSettings         = captchaSettings;
 }
 public CaptchaVerificationService(IOptions <CaptchaSettings> captchaSettings, ILogger <CaptchaVerificationService> logger)
 {
     this.captchaSettings = captchaSettings.Value;
     this.logger          = logger;
 }
Example #19
0
 public CatalogHelper(
     SmartDbContext db,
     ICommonServices services,
     IMenuService menuService,
     IManufacturerService manufacturerService,
     IProductService productService,
     //IProductTemplateService productTemplateService,
     IProductAttributeService productAttributeService,
     IProductAttributeMaterializer productAttributeMaterializer,
     IProductAttributeFormatter productAttributeFormatter,
     ITaxService taxService,
     ICurrencyService currencyService,
     IMediaService mediaService,
     IPriceCalculationService priceCalculationService,
     //IPriceFormatter priceFormatter,
     //ISpecificationAttributeService specificationAttributeService,
     IDateTimeHelper dateTimeHelper,
     //IBackInStockSubscriptionService backInStockSubscriptionService,
     IDownloadService downloadService,
     MediaSettings mediaSettings,
     CatalogSettings catalogSettings,
     CustomerSettings customerSettings,
     CaptchaSettings captchaSettings,
     IMeasureService measureService,
     //IQuantityUnitService quantityUnitService,
     MeasureSettings measureSettings,
     TaxSettings taxSettings,
     PerformanceSettings performanceSettings,
     IDeliveryTimeService deliveryTimeService,
     Lazy <IDataExporter> dataExporter,
     ICatalogSearchService catalogSearchService,
     ICatalogSearchQueryFactory catalogSearchQueryFactory,
     IUrlHelper urlHelper,
     ProductUrlHelper productUrlHelper,
     ILocalizedEntityService localizedEntityService,
     IUrlService urlService,
     ILinkResolver linkResolver)
 {
     _db                  = db;
     _services            = services;
     _workContext         = services.WorkContext;
     _storeContext        = services.StoreContext;
     _cache               = services.Cache;
     _menuService         = menuService;
     _manufacturerService = manufacturerService;
     _productService      = productService;
     //_productTemplateService = productTemplateService;
     _productAttributeService      = productAttributeService;
     _productAttributeMaterializer = productAttributeMaterializer;
     _productAttributeFormatter    = productAttributeFormatter;
     _taxService              = taxService;
     _currencyService         = currencyService;
     _mediaService            = mediaService;
     _localizationService     = _services.Localization;
     _priceCalculationService = priceCalculationService;
     //_priceFormatter = priceFormatter;
     //_specificationAttributeService = specificationAttributeService;
     _dateTimeHelper = dateTimeHelper;
     //_backInStockSubscriptionService = backInStockSubscriptionService;
     _downloadService = downloadService;
     _measureService  = measureService;
     //_quantityUnitService = quantityUnitService;
     _measureSettings           = measureSettings;
     _taxSettings               = taxSettings;
     _performanceSettings       = performanceSettings;
     _deliveryTimeService       = deliveryTimeService;
     _mediaSettings             = mediaSettings;
     _catalogSettings           = catalogSettings;
     _customerSettings          = customerSettings;
     _captchaSettings           = captchaSettings;
     _dataExporter              = dataExporter;
     _catalogSearchService      = catalogSearchService;
     _catalogSearchQueryFactory = catalogSearchQueryFactory;
     _urlHelper              = urlHelper;
     _productUrlHelper       = productUrlHelper;
     _localizedEntityService = localizedEntityService;
     _urlService             = urlService;
     _linkResolver           = linkResolver;
     _httpRequest            = _urlHelper.ActionContext.HttpContext.Request;
 }
Example #20
0
 public CommonModelFactory(BlogSettings blogSettings,
                           CaptchaSettings captchaSettings,
                           CatalogSettings catalogSettings,
                           CommonSettings commonSettings,
                           CustomerSettings customerSettings,
                           DisplayDefaultFooterItemSettings displayDefaultFooterItemSettings,
                           ForumSettings forumSettings,
                           IActionContextAccessor actionContextAccessor,
                           ICompareProductsService compareProductsService,
                           ICategoryService categoryService,
                           ICurrencyService currencyService,
                           ICustomerService customerService,
                           IForumService forumService,
                           IGenericAttributeService genericAttributeService,
                           IHostingEnvironment hostingEnvironment,
                           ILanguageService languageService,
                           ILocalizationService localizationService,
                           IManufacturerService manufacturerService,
                           INopFileProvider fileProvider,
                           IPageHeadBuilder pageHeadBuilder,
                           IPermissionService permissionService,
                           IPictureService pictureService,
                           IProductService productService,
                           IProductTagService productTagService,
                           ISitemapGenerator sitemapGenerator,
                           IStaticCacheManager cacheManager,
                           IStoreContext storeContext,
                           IThemeContext themeContext,
                           IThemeProvider themeProvider,
                           ITopicService topicService,
                           IUrlHelperFactory urlHelperFactory,
                           IUrlRecordService urlRecordService,
                           IWebHelper webHelper,
                           IWorkContext workContext,
                           LocalizationSettings localizationSettings,
                           NewsSettings newsSettings,
                           StoreInformationSettings storeInformationSettings,
                           VendorSettings vendorSettings)
 {
     this._blogSettings                     = blogSettings;
     this._captchaSettings                  = captchaSettings;
     this._compareProductsService           = compareProductsService;
     this._catalogSettings                  = catalogSettings;
     this._commonSettings                   = commonSettings;
     this._customerSettings                 = customerSettings;
     this._displayDefaultFooterItemSettings = displayDefaultFooterItemSettings;
     this._forumSettings                    = forumSettings;
     this._actionContextAccessor            = actionContextAccessor;
     this._categoryService                  = categoryService;
     this._currencyService                  = currencyService;
     this._customerService                  = customerService;
     this._forumService                     = forumService;
     this._genericAttributeService          = genericAttributeService;
     this._hostingEnvironment               = hostingEnvironment;
     this._languageService                  = languageService;
     this._localizationService              = localizationService;
     this._manufacturerService              = manufacturerService;
     this._fileProvider                     = fileProvider;
     this._pageHeadBuilder                  = pageHeadBuilder;
     this._permissionService                = permissionService;
     this._pictureService                   = pictureService;
     this._productService                   = productService;
     this._productTagService                = productTagService;
     this._sitemapGenerator                 = sitemapGenerator;
     this._cacheManager                     = cacheManager;
     this._storeContext                     = storeContext;
     this._themeContext                     = themeContext;
     this._themeProvider                    = themeProvider;
     this._topicService                     = topicService;
     this._urlHelperFactory                 = urlHelperFactory;
     this._urlRecordService                 = urlRecordService;
     this._webHelper                = webHelper;
     this._workContext              = workContext;
     this._localizationSettings     = localizationSettings;
     this._newsSettings             = newsSettings;
     this._storeInformationSettings = storeInformationSettings;
     this._vendorSettings           = vendorSettings;
 }
 public ValidateCaptchaFilter(string actionParameterName, CaptchaSettings captchaSettings)
 {
     _actionParameterName = actionParameterName;
     _captchaSettings     = captchaSettings;
 }
 public SubmissionController(IRepository <SubmissionRecord> submissionRepo, IDownloadService downloadService,
                             ISettingService settings, IWorkContext workContext, ILocalizationService localizationService, CaptchaSettings captchaSettings,
                             IEmailSender emailSender, ILogger logger, IEmailAccountService emailAccountService, EmailAccountSettings emailAccountSettings)
 {
     _submissionRepo      = submissionRepo;
     _downloadService     = downloadService;
     _settings            = settings;
     _workContext         = workContext;
     _localizationService = localizationService;
     _captchaSettings     = captchaSettings;
     _emailSender         = emailSender;
     _logger = logger;
     _emailAccountService  = emailAccountService;
     _emailAccountSettings = emailAccountSettings;
 }
Example #23
0
        public virtual async Task <IActionResult> VendorReviewsAdd(string vendorId, VendorReviewsModel model, bool captchaValid,
                                                                   [FromServices] CaptchaSettings captchaSettings)
        {
            var vendor = await _vendorService.GetVendorById(vendorId);

            if (vendor == null || !vendor.Active || !vendor.AllowCustomerReviews)
            {
                return(RedirectToRoute("HomePage"));
            }

            //validate CAPTCHA
            if (captchaSettings.Enabled && captchaSettings.ShowOnVendorReviewPage && !captchaValid)
            {
                ModelState.AddModelError("", captchaSettings.GetWrongCaptchaMessage(_localizationService));
            }

            if (_workContext.CurrentCustomer.IsGuest() && !_vendorSettings.AllowAnonymousUsersToReviewVendor)
            {
                ModelState.AddModelError("", _localizationService.GetResource("VendorReviews.OnlyRegisteredUsersCanWriteReviews"));
            }

            //allow reviews only by customer that bought something from this vendor
            if (_vendorSettings.VendorReviewPossibleOnlyAfterPurchasing &&
                !(await _mediator.Send(new GetOrderQuery()
            {
                CustomerId = _workContext.CurrentCustomer.Id,
                VendorId = vendorId,
                Os = OrderStatus.Completed,
                PageSize = 1
            })).Any())
            {
                ModelState.AddModelError(string.Empty, _localizationService.GetResource("VendorReviews.VendorReviewPossibleOnlyAfterPurchasing"));
            }

            if (ModelState.IsValid)
            {
                var vendorReview = await _mediator.Send(new InsertVendorReviewCommand()
                {
                    Vendor = vendor, Store = _storeContext.CurrentStore, Model = model
                });

                //activity log
                await _customerActivityService.InsertActivity("PublicStore.AddVendorReview", vendor.Id, _localizationService.GetResource("ActivityLog.PublicStore.AddVendorReview"), vendor.Name);

                //raise event
                if (vendorReview.IsApproved)
                {
                    await _mediator.Publish(new VendorReviewApprovedEvent(vendorReview));
                }

                model = await _mediator.Send(new GetVendorReviews()
                {
                    Vendor = vendor
                });

                model.AddVendorReview.Title      = null;
                model.AddVendorReview.ReviewText = null;

                model.AddVendorReview.SuccessfullyAdded = true;
                if (!vendorReview.IsApproved)
                {
                    model.AddVendorReview.Result = _localizationService.GetResource("VendorReviews.SeeAfterApproving");
                }
                else
                {
                    model.AddVendorReview.Result = _localizationService.GetResource("VendorReviews.SuccessfullyAdded");
                }

                return(View(model));
            }
            model = await _mediator.Send(new GetVendorReviews()
            {
                Vendor = vendor
            });

            return(View(model));
        }
        public GBSLoginController(IAddressModelFactory addressModelFactory,
                                  ICustomerModelFactory customerModelFactory,
                                  IAuthenticationService authenticationService,
                                  DateTimeSettings dateTimeSettings,
                                  TaxSettings taxSettings,
                                  ILocalizationService localizationService,
                                  IWorkContext workContext,
                                  IStoreContext storeContext,
                                  ICustomerService customerService,
                                  ICustomerAttributeParser customerAttributeParser,
                                  ICustomerAttributeService customerAttributeService,
                                  IGenericAttributeService genericAttributeService,
                                  ICustomerRegistrationService customerRegistrationService,
                                  ITaxService taxService,
                                  CustomerSettings customerSettings,
                                  AddressSettings addressSettings,
                                  ForumSettings forumSettings,
                                  IAddressService addressService,
                                  ICountryService countryService,
                                  IOrderService orderService,
                                  IPictureService pictureService,
                                  INewsLetterSubscriptionService newsLetterSubscriptionService,
                                  IShoppingCartService shoppingCartService,
                                  IWebHelper webHelper,
                                  ICustomerActivityService customerActivityService,
                                  IAddressAttributeParser addressAttributeParser,
                                  IAddressAttributeService addressAttributeService,
                                  IStoreService storeService,
                                  IEventPublisher eventPublisher,
                                  MediaSettings mediaSettings,
                                  IWorkflowMessageService workflowMessageService,
                                  LocalizationSettings localizationSettings,
                                  CaptchaSettings captchaSettings,
                                  StoreInformationSettings storeInformationSettings,
                                  ILogger logger,
                                  CaptchaSettings _captchaSettings,
                                  IExternalAuthenticationService externalAuthenticationService)
        {
            this._addressModelFactory         = addressModelFactory;
            this._customerModelFactory        = customerModelFactory;
            this._authenticationService       = authenticationService;
            this._dateTimeSettings            = dateTimeSettings;
            this._taxSettings                 = taxSettings;
            this._localizationService         = localizationService;
            this._workContext                 = workContext;
            this._storeContext                = storeContext;
            this._customerService             = customerService;
            this._customerAttributeParser     = customerAttributeParser;
            this._customerAttributeService    = customerAttributeService;
            this._genericAttributeService     = genericAttributeService;
            this._customerRegistrationService = customerRegistrationService;
            this._taxService       = taxService;
            this._customerSettings = customerSettings;
            this._addressSettings  = addressSettings;
            this._forumSettings    = forumSettings;
            this._addressService   = addressService;
            this._countryService   = countryService;
            this._orderService     = orderService;
            this._pictureService   = pictureService;
            this._newsLetterSubscriptionService = newsLetterSubscriptionService;
            this._shoppingCartService           = shoppingCartService;
            this._webHelper = webHelper;
            this._customerActivityService  = customerActivityService;
            this._addressAttributeParser   = addressAttributeParser;
            this._addressAttributeService  = addressAttributeService;
            this._storeService             = storeService;
            this._eventPublisher           = eventPublisher;
            this._mediaSettings            = mediaSettings;
            this._workflowMessageService   = workflowMessageService;
            this._localizationSettings     = localizationSettings;
            this._captchaSettings          = captchaSettings;
            this._storeInformationSettings = storeInformationSettings;
            this._logger = logger;
            this._externalAuthenticationService = externalAuthenticationService;

            this._baseNopCustomerController = new Nop.Web.Controllers.CustomerController(
                this._addressModelFactory,
                this._customerModelFactory,
                this._authenticationService,
                this._dateTimeSettings,
                this._taxSettings,
                this._localizationService,
                this._workContext,
                this._storeContext,
                this._customerService,
                this._customerAttributeParser,
                this._customerAttributeService,
                this._genericAttributeService,
                this._customerRegistrationService,
                this._taxService,
                this._customerSettings,
                this._addressSettings,
                this._forumSettings,
                this._addressService,
                this._countryService,
                this._orderService,
                this._pictureService,
                this._newsLetterSubscriptionService,
                this._shoppingCartService,
                this._externalAuthenticationService,
                this._webHelper,
                this._customerActivityService,
                this._addressAttributeParser,
                this._addressAttributeService,
                this._eventPublisher,
                this._mediaSettings,
                this._workflowMessageService,
                this._localizationSettings,
                this._captchaSettings,
                this._storeInformationSettings);
        }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="htmlHelper">HTML helper</param>
 public NopGenerateCaptchaTagHelper(IHtmlHelper htmlHelper, CaptchaSettings captchaSettings)
 {
     _htmlHelper      = htmlHelper;
     _captchaSettings = captchaSettings;
 }
Example #26
0
 public CaptchaValidationService(CaptchaSettings captchaSettings)
 {
     _captchaSettings = captchaSettings;
 }
        public ProductController(
            ICommonServices services,
            IManufacturerService manufacturerService,
            IProductService productService,
            IProductAttributeService productAttributeService,
            IProductAttributeParser productAttributeParser,
            ITaxService taxService,
            ICurrencyService currencyService,
            IPictureService pictureService,
            IPriceCalculationService priceCalculationService,
            IPriceFormatter priceFormatter,
            ICustomerContentService customerContentService,
            ICustomerService customerService,
            IShoppingCartService shoppingCartService,
            IRecentlyViewedProductsService recentlyViewedProductsService,
            IProductTagService productTagService,
            IOrderReportService orderReportService,
            IBackInStockSubscriptionService backInStockSubscriptionService,
            IAclService aclService,
            IStoreMappingService storeMappingService,
            MediaSettings mediaSettings,
            SeoSettings seoSettings,
            CatalogSettings catalogSettings,
            ShoppingCartSettings shoppingCartSettings,
            LocalizationSettings localizationSettings,
            CaptchaSettings captchaSettings,
            CatalogHelper helper,
            IDownloadService downloadService,
            ILocalizationService localizationService,
            IBreadcrumb breadcrumb,
            Lazy <PrivacySettings> privacySettings,
            Lazy <TaxSettings> taxSettings,
            IRepository <Category> categoryRepository,
            ICategoryService categoryService

            )
        {
            _services                       = services;
            _manufacturerService            = manufacturerService;
            _productService                 = productService;
            _productAttributeService        = productAttributeService;
            _productAttributeParser         = productAttributeParser;
            _taxService                     = taxService;
            _currencyService                = currencyService;
            _pictureService                 = pictureService;
            _priceCalculationService        = priceCalculationService;
            _priceFormatter                 = priceFormatter;
            _customerContentService         = customerContentService;
            _customerService                = customerService;
            _shoppingCartService            = shoppingCartService;
            _recentlyViewedProductsService  = recentlyViewedProductsService;
            _productTagService              = productTagService;
            _orderReportService             = orderReportService;
            _backInStockSubscriptionService = backInStockSubscriptionService;
            _aclService                     = aclService;
            _storeMappingService            = storeMappingService;
            _mediaSettings                  = mediaSettings;
            _seoSettings                    = seoSettings;
            _catalogSettings                = catalogSettings;
            _shoppingCartSettings           = shoppingCartSettings;
            _localizationSettings           = localizationSettings;
            _captchaSettings                = captchaSettings;
            _helper              = helper;
            _downloadService     = downloadService;
            _localizationService = localizationService;
            _breadcrumb          = breadcrumb;
            _privacySettings     = privacySettings;
            _taxSettings         = taxSettings;
            _categoryRepository  = categoryRepository;
            _categoryService     = categoryService;
        }
Example #28
0
 public CustomerController(IAuthenticationService authenticationService,
                           IDateTimeHelper dateTimeHelper,
                           DateTimeSettings dateTimeSettings,
                           TaxSettings taxSettings,
                           ILocalizationService localizationService,
                           IWorkContext workContext,
                           IStoreContext storeContext,
                           IStoreMappingService storeMappingService,
                           ICustomerService customerService,
                           ICustomerAttributeParser customerAttributeParser,
                           ICustomerAttributeService customerAttributeService,
                           IGenericAttributeService genericAttributeService,
                           ICustomerRegistrationService customerRegistrationService,
                           ITaxService taxService,
                           RewardPointsSettings rewardPointsSettings,
                           CustomerSettings customerSettings,
                           AddressSettings addressSettings,
                           ForumSettings forumSettings,
                           OrderSettings orderSettings,
                           IAddressService addressService,
                           ICountryService countryService,
                           IStateProvinceService stateProvinceService,
                           IOrderService orderService,
                           IPictureService pictureService,
                           INewsLetterSubscriptionService newsLetterSubscriptionService,
                           IShoppingCartService shoppingCartService,
                           IOpenAuthenticationService openAuthenticationService,
                           IDownloadService downloadService,
                           IWebHelper webHelper,
                           ICustomerActivityService customerActivityService,
                           IAddressAttributeParser addressAttributeParser,
                           IAddressAttributeService addressAttributeService,
                           IAddressAttributeFormatter addressAttributeFormatter,
                           IReturnRequestService returnRequestService,
                           IEventPublisher eventPublisher,
                           MediaSettings mediaSettings,
                           IWorkflowMessageService workflowMessageService,
                           LocalizationSettings localizationSettings,
                           CaptchaSettings captchaSettings,
                           SecuritySettings securitySettings,
                           ExternalAuthenticationSettings externalAuthenticationSettings,
                           StoreInformationSettings storeInformationSettings)
 {
     this._authenticationService       = authenticationService;
     this._dateTimeHelper              = dateTimeHelper;
     this._dateTimeSettings            = dateTimeSettings;
     this._taxSettings                 = taxSettings;
     this._localizationService         = localizationService;
     this._workContext                 = workContext;
     this._storeContext                = storeContext;
     this._storeMappingService         = storeMappingService;
     this._customerService             = customerService;
     this._customerAttributeParser     = customerAttributeParser;
     this._customerAttributeService    = customerAttributeService;
     this._genericAttributeService     = genericAttributeService;
     this._customerRegistrationService = customerRegistrationService;
     this._taxService                    = taxService;
     this._rewardPointsSettings          = rewardPointsSettings;
     this._customerSettings              = customerSettings;
     this._addressSettings               = addressSettings;
     this._forumSettings                 = forumSettings;
     this._orderSettings                 = orderSettings;
     this._addressService                = addressService;
     this._countryService                = countryService;
     this._stateProvinceService          = stateProvinceService;
     this._orderService                  = orderService;
     this._pictureService                = pictureService;
     this._newsLetterSubscriptionService = newsLetterSubscriptionService;
     this._shoppingCartService           = shoppingCartService;
     this._openAuthenticationService     = openAuthenticationService;
     this._downloadService               = downloadService;
     this._webHelper = webHelper;
     this._customerActivityService        = customerActivityService;
     this._addressAttributeParser         = addressAttributeParser;
     this._addressAttributeService        = addressAttributeService;
     this._addressAttributeFormatter      = addressAttributeFormatter;
     this._returnRequestService           = returnRequestService;
     this._eventPublisher                 = eventPublisher;
     this._mediaSettings                  = mediaSettings;
     this._workflowMessageService         = workflowMessageService;
     this._localizationSettings           = localizationSettings;
     this._captchaSettings                = captchaSettings;
     this._securitySettings               = securitySettings;
     this._externalAuthenticationSettings = externalAuthenticationSettings;
     this._storeInformationSettings       = storeInformationSettings;
 }
        public virtual IActionResult VendorReviewsAdd(string vendorId, VendorReviewsModel model, bool captchaValid,
                                                      [FromServices] IOrderService orderService, [FromServices] IEventPublisher eventPublisher, [FromServices] CaptchaSettings captchaSettings)
        {
            var vendor = _vendorService.GetVendorById(vendorId);

            if (vendor == null || !vendor.Active || !vendor.AllowCustomerReviews)
            {
                return(RedirectToRoute("HomePage"));
            }

            //validate CAPTCHA
            if (captchaSettings.Enabled && captchaSettings.ShowOnVendorReviewPage && !captchaValid)
            {
                ModelState.AddModelError("", captchaSettings.GetWrongCaptchaMessage(_localizationService));
            }

            if (_workContext.CurrentCustomer.IsGuest() && !_vendorSettings.AllowAnonymousUsersToReviewVendor)
            {
                ModelState.AddModelError("", _localizationService.GetResource("VendorReviews.OnlyRegisteredUsersCanWriteReviews"));
            }

            //allow reviews only by customer that bought something from this vendor
            if (_vendorSettings.VendorReviewPossibleOnlyAfterPurchasing &&
                !orderService.SearchOrders(customerId: _workContext.CurrentCustomer.Id, vendorId: vendorId, os: OrderStatus.Complete).Any())
            {
                ModelState.AddModelError(string.Empty, _localizationService.GetResource("VendorReviews.VendorReviewPossibleOnlyAfterPurchasing"));
            }

            if (ModelState.IsValid)
            {
                var vendorReview = _vendorViewModelService.InsertVendorReview(vendor, model);
                //activity log
                _customerActivityService.InsertActivity("PublicStore.AddVendorReview", vendor.Id, _localizationService.GetResource("ActivityLog.PublicStore.AddVendorReview"), vendor.Name);

                //raise event
                if (vendorReview.IsApproved)
                {
                    eventPublisher.Publish(new VendorReviewApprovedEvent(vendorReview));
                }

                _vendorViewModelService.PrepareVendorReviewsModel(model, vendor);
                model.AddVendorReview.Title      = null;
                model.AddVendorReview.ReviewText = null;

                model.AddVendorReview.SuccessfullyAdded = true;
                if (!vendorReview.IsApproved)
                {
                    model.AddVendorReview.Result = _localizationService.GetResource("VendorReviews.SeeAfterApproving");
                }
                else
                {
                    model.AddVendorReview.Result = _localizationService.GetResource("VendorReviews.SuccessfullyAdded");
                }

                return(View(model));
            }

            //If we got this far, something failed, redisplay form
            _vendorViewModelService.PrepareVendorReviewsModel(model, vendor);
            return(View(model));
        }
Example #30
0
        public CommonWebService(ICacheManager cacheManager,
                                IStoreContext storeContext,
                                IStoreService storeService,
                                IThemeContext themeContext,
                                IPictureService pictureService,
                                IWebHelper webHelper,
                                ILanguageService languageService,
                                IWorkContext workContext,
                                ICurrencyService currencyService,
                                IPermissionService permissionService,
                                IPageHeadBuilder pageHeadBuilder,
                                ITopicService topicService,
                                IWorkflowMessageService workflowMessageService,
                                ILocalizationService localizationService,
                                ICategoryService categoryService,
                                IManufacturerService manufacturerService,
                                IProductService productService,
                                ISitemapGenerator sitemapGenerator,
                                IThemeProvider themeProvider,
                                IForumService forumservice,
                                IHostingEnvironment hostingEnvironment,
                                StoreInformationSettings storeInformationSettings,
                                LocalizationSettings localizationSettings,
                                TaxSettings taxSettings,
                                CustomerSettings customerSettings,
                                ForumSettings forumSettings,
                                CatalogSettings catalogSettings,
                                BlogSettings blogSettings,
                                NewsSettings newsSettings,
                                VendorSettings vendorSettings,
                                CommonSettings commonSettings,
                                CaptchaSettings captchaSettings
                                )
        {
            this._cacheManager           = cacheManager;
            this._storeContext           = storeContext;
            this._storeService           = storeService;
            this._themeContext           = themeContext;
            this._pictureService         = pictureService;
            this._webHelper              = webHelper;
            this._languageService        = languageService;
            this._workContext            = workContext;
            this._currencyService        = currencyService;
            this._permissionService      = permissionService;
            this._pageHeadBuilder        = pageHeadBuilder;
            this._topicService           = topicService;
            this._workflowMessageService = workflowMessageService;
            this._localizationService    = localizationService;
            this._categoryService        = categoryService;
            this._manufacturerService    = manufacturerService;
            this._productService         = productService;
            this._sitemapGenerator       = sitemapGenerator;
            this._themeProvider          = themeProvider;
            this._forumservice           = forumservice;
            this._hostingEnvironment     = hostingEnvironment;

            this._storeInformationSettings = storeInformationSettings;
            this._localizationSettings     = localizationSettings;
            this._taxSettings      = taxSettings;
            this._customerSettings = customerSettings;
            this._forumSettings    = forumSettings;
            this._catalogSettings  = catalogSettings;
            this._blogSettings     = blogSettings;
            this._newsSettings     = newsSettings;
            this._vendorSettings   = vendorSettings;
            this._commonSettings   = commonSettings;
            this._captchaSettings  = captchaSettings;
        }