public CheckIfUserTicketDataIsStaleFilter(
     IRequestCache requestCache,
     IUmbracoMapper umbracoMapper,
     IUserService userService,
     IEntityService entityService,
     ILocalizedTextService localizedTextService,
     IOptions <GlobalSettings> globalSettings,
     IBackOfficeSignInManager backOfficeSignInManager,
     IBackOfficeAntiforgery backOfficeAntiforgery,
     IScopeProvider scopeProvider,
     AppCaches appCaches)
 {
     _requestCache            = requestCache;
     _umbracoMapper           = umbracoMapper;
     _userService             = userService;
     _entityService           = entityService;
     _localizedTextService    = localizedTextService;
     _globalSettings          = globalSettings;
     _backOfficeSignInManager = backOfficeSignInManager;
     _backOfficeAntiforgery   = backOfficeAntiforgery;
     _scopeProvider           = scopeProvider;
     _appCaches = appCaches;
 }
예제 #2
0
        /// <summary>
        /// Returns the localized root node display name
        /// </summary>
        /// <param name="textService"></param>
        /// <returns></returns>
        public string GetRootNodeDisplayName(ILocalizedTextService textService)
        {
            var label = $"[{Alias}]";

            // try to look up a the localized tree header matching the tree alias
            var localizedLabel = textService.Localize("treeHeaders/" + Alias);

            // if the localizedLabel returns [alias] then return the title attribute from the trees.config file, if it's defined
            if (localizedLabel != null && localizedLabel.Equals(label, StringComparison.InvariantCultureIgnoreCase))
            {
                if (string.IsNullOrEmpty(Title) == false)
                {
                    label = Title;
                }
            }
            else
            {
                // the localizedLabel translated into something that's not just [alias], so use the translation
                label = localizedLabel;
            }

            return(label);
        }
예제 #3
0
 public CodeFileController(
     IHostingEnvironment hostingEnvironment,
     FileSystems fileSystems,
     IFileService fileService,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     IUmbracoMapper umbracoMapper,
     IShortStringHelper shortStringHelper,
     IOptionsSnapshot <GlobalSettings> globalSettings,
     PartialViewSnippetCollection partialViewSnippetCollection,
     PartialViewMacroSnippetCollection partialViewMacroSnippetCollection)
 {
     _hostingEnvironment                = hostingEnvironment;
     _fileSystems                       = fileSystems;
     _fileService                       = fileService;
     _backOfficeSecurityAccessor        = backOfficeSecurityAccessor;
     _localizedTextService              = localizedTextService;
     _umbracoMapper                     = umbracoMapper;
     _shortStringHelper                 = shortStringHelper;
     _globalSettings                    = globalSettings.Value;
     _partialViewSnippetCollection      = partialViewSnippetCollection;
     _partialViewMacroSnippetCollection = partialViewMacroSnippetCollection;
 }
 public RichTextPropertyValueEditor(
     DataEditorAttribute attribute,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     HtmlImageSourceParser imageSourceParser,
     HtmlLocalLinkParser localLinkParser,
     RichTextEditorPastedImages pastedImages,
     IImageUrlGenerator imageUrlGenerator,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     IHtmlSanitizer htmlSanitizer,
     IHtmlMacroParameterParser macroParameterParser)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
     _imageSourceParser          = imageSourceParser;
     _localLinkParser            = localLinkParser;
     _pastedImages         = pastedImages;
     _imageUrlGenerator    = imageUrlGenerator;
     _htmlSanitizer        = htmlSanitizer;
     _macroParameterParser = macroParameterParser;
 }
예제 #5
0
 public UserGroupsController(
     IUserService userService,
     IContentService contentService,
     IEntityService entityService,
     IMediaService mediaService,
     IBackOfficeSecurityAccessor backofficeSecurityAccessor,
     IUmbracoMapper umbracoMapper,
     ILocalizedTextService localizedTextService,
     IShortStringHelper shortStringHelper,
     AppCaches appCaches)
 {
     _userService                = userService ?? throw new ArgumentNullException(nameof(userService));
     _contentService             = contentService ?? throw new ArgumentNullException(nameof(contentService));
     _entityService              = entityService ?? throw new ArgumentNullException(nameof(entityService));
     _mediaService               = mediaService ?? throw new ArgumentNullException(nameof(mediaService));
     _backofficeSecurityAccessor = backofficeSecurityAccessor ??
                                   throw new ArgumentNullException(nameof(backofficeSecurityAccessor));
     _umbracoMapper        = umbracoMapper ?? throw new ArgumentNullException(nameof(umbracoMapper));
     _localizedTextService =
         localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
     _shortStringHelper = shortStringHelper ?? throw new ArgumentNullException(nameof(shortStringHelper));
     _appCaches         = appCaches ?? throw new ArgumentNullException(nameof(appCaches));
 }
예제 #6
0
        private static string UmbracoDictionaryTranslate(this ILocalizedTextService manager, string text, ICultureDictionary cultureDictionary)
        {
            if (text == null)
            {
                return(null);
            }

            if (text.StartsWith("#") == false)
            {
                return(text);
            }

            text = text.Substring(1);
            var value = cultureDictionary[text];

            if (value.IsNullOrWhiteSpace() == false)
            {
                return(value);
            }

            value = manager.Localize(text.Replace('_', '/'));
            return(value.StartsWith("[") ? text : value);
        }
        public ContentPropertyMapperProfile(IDataTypeService dataTypeService, ILocalizedTextService textService, ILogger logger, PropertyEditorCollection propertyEditors)
        {
            var contentPropertyBasicConverter   = new ContentPropertyBasicConverter <ContentPropertyBasic>(dataTypeService, logger, propertyEditors);
            var contentPropertyDtoConverter     = new ContentPropertyDtoConverter(dataTypeService, logger, propertyEditors);
            var contentPropertyDisplayConverter = new ContentPropertyDisplayConverter(dataTypeService, textService, logger, propertyEditors);

            //FROM Property TO ContentPropertyBasic
            CreateMap <PropertyGroup, Tab <ContentPropertyDisplay> >()
            .ForMember(tab => tab.Label, expression => expression.MapFrom(@group => @group.Name))
            .ForMember(tab => tab.IsActive, expression => expression.MapFrom(_ => true))
            .ForMember(tab => tab.Properties, expression => expression.Ignore())
            .ForMember(tab => tab.Alias, expression => expression.Ignore())
            .ForMember(tab => tab.Expanded, expression => expression.Ignore());

            //FROM Property TO ContentPropertyBasic
            CreateMap <Property, ContentPropertyBasic>().ConvertUsing(contentPropertyBasicConverter);

            //FROM Property TO ContentPropertyDto
            CreateMap <Property, ContentPropertyDto>().ConvertUsing(contentPropertyDtoConverter);

            //FROM Property TO ContentPropertyDisplay
            CreateMap <Property, ContentPropertyDisplay>().ConvertUsing(contentPropertyDisplayConverter);
        }
예제 #8
0
 public UserMapDefinition(
     ILocalizedTextService textService,
     IUserService userService,
     IEntityService entityService,
     ISectionService sectionService,
     AppCaches appCaches,
     ActionCollection actions,
     IOptions <GlobalSettings> globalSettings,
     MediaFileManager mediaFileManager,
     IShortStringHelper shortStringHelper,
     IImageUrlGenerator imageUrlGenerator)
 {
     _sectionService    = sectionService;
     _entityService     = entityService;
     _userService       = userService;
     _textService       = textService;
     _actions           = actions;
     _appCaches         = appCaches;
     _globalSettings    = globalSettings.Value;
     _mediaFileManager  = mediaFileManager;
     _shortStringHelper = shortStringHelper;
     _imageUrlGenerator = imageUrlGenerator;
 }
예제 #9
0
        internal MenuItem CreateMenuItem <T>(ILocalizedTextService textService, bool hasSeparator = false, bool opensDialog = false)
            where T : IAction
        {
            var item = Current.Actions.GetAction <T>();

            if (item == null)
            {
                return(null);
            }

            var values = textService.GetAllStoredValues(Thread.CurrentThread.CurrentUICulture);

            values.TryGetValue($"visuallyHiddenTexts/{item.Alias}Description", out var textDescription);

            var menuItem = new MenuItem(item, textService.Localize($"actions/{item.Alias}"))
            {
                SeparatorBefore = hasSeparator,
                OpensDialog     = opensDialog,
                TextDescription = textDescription,
            };

            return(menuItem);
        }
예제 #10
0
 public DataTypeService(
     IDataValueEditorFactory dataValueEditorFactory,
     ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory,
     IDataTypeRepository dataTypeRepository, IDataTypeContainerRepository dataTypeContainerRepository,
     IAuditRepository auditRepository, IEntityRepository entityRepository, IContentTypeRepository contentTypeRepository,
     IIOHelper ioHelper, ILocalizedTextService localizedTextService, ILocalizationService localizationService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer)
     : this(
         dataValueEditorFactory,
         provider,
         loggerFactory,
         eventMessagesFactory,
         dataTypeRepository,
         dataTypeContainerRepository,
         auditRepository,
         entityRepository,
         contentTypeRepository,
         ioHelper,
         localizedTextService,
         localizationService,
         shortStringHelper,
         jsonSerializer,
         StaticServiceProvider.Instance.GetRequiredService<IEditorConfigurationParser>())
 {
     _dataValueEditorFactory = dataValueEditorFactory;
     _dataTypeRepository = dataTypeRepository;
     _dataTypeContainerRepository = dataTypeContainerRepository;
     _auditRepository = auditRepository;
     _entityRepository = entityRepository;
     _contentTypeRepository = contentTypeRepository;
     _ioHelper = ioHelper;
     _localizedTextService = localizedTextService;
     _localizationService = localizationService;
     _shortStringHelper = shortStringHelper;
     _jsonSerializer = jsonSerializer;
 }
예제 #11
0
        // TODO: We need to review all _userManager.Raise calls since many/most should be on the usermanager or signinmanager, very few should be here

        public AuthenticationController(
            IBackOfficeSecurityAccessor backofficeSecurityAccessor,
            IBackOfficeUserManager backOfficeUserManager,
            IBackOfficeSignInManager signInManager,
            IUserService userService,
            ILocalizedTextService textService,
            IUmbracoMapper umbracoMapper,
            IOptions <GlobalSettings> globalSettings,
            IOptions <SecuritySettings> securitySettings,
            ILogger <AuthenticationController> logger,
            IIpResolver ipResolver,
            IOptions <UserPasswordConfigurationSettings> passwordConfiguration,
            IEmailSender emailSender,
            ISmsSender smsSender,
            IHostingEnvironment hostingEnvironment,
            LinkGenerator linkGenerator,
            IBackOfficeExternalLoginProviders externalAuthenticationOptions,
            IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions)
        {
            _backofficeSecurityAccessor = backofficeSecurityAccessor;
            _userManager                   = backOfficeUserManager;
            _signInManager                 = signInManager;
            _userService                   = userService;
            _textService                   = textService;
            _umbracoMapper                 = umbracoMapper;
            _globalSettings                = globalSettings.Value;
            _securitySettings              = securitySettings.Value;
            _logger                        = logger;
            _ipResolver                    = ipResolver;
            _passwordConfiguration         = passwordConfiguration.Value;
            _emailSender                   = emailSender;
            _smsSender                     = smsSender;
            _hostingEnvironment            = hostingEnvironment;
            _linkGenerator                 = linkGenerator;
            _externalAuthenticationOptions = externalAuthenticationOptions;
            _backOfficeTwoFactorOptions    = backOfficeTwoFactorOptions;
        }
 protected ContentTreeControllerBase(
     ILocalizedTextService localizedTextService,
     UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
     IMenuItemCollectionFactory menuItemCollectionFactory,
     IEntityService entityService,
     IBackOfficeSecurityAccessor backofficeSecurityAccessor,
     ILogger <ContentTreeControllerBase> logger,
     ActionCollection actionCollection,
     IUserService userService,
     IDataTypeService dataTypeService,
     IEventAggregator eventAggregator,
     AppCaches appCaches
     )
     : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator)
 {
     _entityService = entityService;
     _backofficeSecurityAccessor = backofficeSecurityAccessor;
     _logger                   = logger;
     _actionCollection         = actionCollection;
     _userService              = userService;
     _dataTypeService          = dataTypeService;
     _appCaches                = appCaches;
     MenuItemCollectionFactory = menuItemCollectionFactory;
 }
예제 #13
0
 public DataTypeService(
     IDataValueEditorFactory dataValueEditorFactory,
     ICoreScopeProvider provider, ILoggerFactory loggerFactory, IEventMessagesFactory eventMessagesFactory,
     IDataTypeRepository dataTypeRepository, IDataTypeContainerRepository dataTypeContainerRepository,
     IAuditRepository auditRepository, IEntityRepository entityRepository, IContentTypeRepository contentTypeRepository,
     IIOHelper ioHelper, ILocalizedTextService localizedTextService, ILocalizationService localizationService,
     IShortStringHelper shortStringHelper,
     IJsonSerializer jsonSerializer,
     IEditorConfigurationParser editorConfigurationParser)
     : base(provider, loggerFactory, eventMessagesFactory)
 {
     _dataValueEditorFactory = dataValueEditorFactory;
     _dataTypeRepository = dataTypeRepository;
     _dataTypeContainerRepository = dataTypeContainerRepository;
     _auditRepository = auditRepository;
     _entityRepository = entityRepository;
     _contentTypeRepository = contentTypeRepository;
     _ioHelper = ioHelper;
     _localizedTextService = localizedTextService;
     _localizationService = localizationService;
     _shortStringHelper = shortStringHelper;
     _jsonSerializer = jsonSerializer;
     _editorConfigurationParser = editorConfigurationParser;
 }
예제 #14
0
 public MediaTreeController(
     ILocalizedTextService localizedTextService,
     UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
     IMenuItemCollectionFactory menuItemCollectionFactory,
     IEntityService entityService,
     IBackOfficeSecurityAccessor backofficeSecurityAccessor,
     ILogger <MediaTreeController> logger,
     ActionCollection actionCollection,
     IUserService userService,
     IDataTypeService dataTypeService,
     UmbracoTreeSearcher treeSearcher,
     IMediaService mediaService,
     IEventAggregator eventAggregator,
     AppCaches appCaches)
     : base(localizedTextService, umbracoApiControllerTypeCollection, menuItemCollectionFactory, entityService,
            backofficeSecurityAccessor, logger, actionCollection, userService, dataTypeService, eventAggregator,
            appCaches)
 {
     _treeSearcher  = treeSearcher;
     _mediaService  = mediaService;
     _appCaches     = appCaches;
     _entityService = entityService;
     _backofficeSecurityAccessor = backofficeSecurityAccessor;
 }
예제 #15
0
 public GridPropertyValueEditor(
     IDataValueEditorFactory dataValueEditorFactory,
     DataEditorAttribute attribute,
     IBackOfficeSecurityAccessor backOfficeSecurityAccessor,
     ILocalizedTextService localizedTextService,
     HtmlImageSourceParser imageSourceParser,
     RichTextEditorPastedImages pastedImages,
     IShortStringHelper shortStringHelper,
     IImageUrlGenerator imageUrlGenerator,
     IJsonSerializer jsonSerializer,
     IIOHelper ioHelper,
     IHtmlMacroParameterParser macroParameterParser)
     : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
 {
     _backOfficeSecurityAccessor = backOfficeSecurityAccessor;
     _imageSourceParser          = imageSourceParser;
     _pastedImages = pastedImages;
     _richTextPropertyValueEditor =
         dataValueEditorFactory.Create <RichTextPropertyEditor.RichTextPropertyValueEditor>(attribute);
     _mediaPickerPropertyValueEditor =
         dataValueEditorFactory.Create <MediaPickerPropertyEditor.MediaPickerPropertyValueEditor>(attribute);
     _imageUrlGenerator    = imageUrlGenerator;
     _macroParameterParser = macroParameterParser;
 }
 public ContentPropertyDisplayConverter(IDataTypeService dataTypeService, ILocalizedTextService textService, IEntityService entityService)
     : base(dataTypeService, entityService)
 {
     _textService = textService;
 }
예제 #17
0
 public TranslationController(ILocalizedTextService localizedTextService)
 {
     _localizedTextService = localizedTextService;
 }
예제 #18
0
 public ExcessiveHeadersCheck(ILocalizedTextService textService, IRuntimeState runtime, IHttpContextAccessor httpContextAccessor)
 {
     _textService         = textService;
     _runtime             = runtime;
     _httpContextAccessor = httpContextAccessor;
 }
예제 #19
0
 public MacroRenderer(IProfilingLogger plogger, IUmbracoContextAccessor umbracoContextAccessor, IContentSection contentSection, ILocalizedTextService textService, AppCaches appCaches, IMacroService macroService)
 {
     _plogger = plogger ?? throw new ArgumentNullException(nameof(plogger));
     _umbracoContextAccessor = umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor));
     _contentSection         = contentSection ?? throw new ArgumentNullException(nameof(contentSection));
     _textService            = textService;
     _appCaches    = appCaches ?? throw new ArgumentNullException(nameof(appCaches));
     _macroService = macroService ?? throw new ArgumentNullException(nameof(macroService));
 }
예제 #20
0
 protected UmbracoErrorDescriberBase(ILocalizedTextService textService) => _textService = textService;
예제 #21
0
 public MemberTabsAndPropertiesResolver(IUmbracoContextAccessor umbracoContextAccessor, ILocalizedTextService localizedTextService, IMemberService memberService, IUserService userService)
     : base(localizedTextService)
 {
     _umbracoContextAccessor = umbracoContextAccessor ?? throw new System.ArgumentNullException(nameof(umbracoContextAccessor));
     _localizedTextService   = localizedTextService ?? throw new System.ArgumentNullException(nameof(localizedTextService));
     _memberService          = memberService ?? throw new System.ArgumentNullException(nameof(memberService));
     _userService            = userService ?? throw new System.ArgumentNullException(nameof(userService));
 }
        /// <summary>
        /// A helper method to mimic the default Umbraco notifications based on PublishStatus
        /// </summary>
        /// <remarks>
        /// From umbraco source - ContentController.PostSave -> ShowMessageForPublishStatus
        /// </remarks>
        public static IEnumerable<EventMessage> GetUmbracoDefaultEventMessages(PublishStatus status, ILocalizedTextService textService)
        {
            var messages = new List<EventMessage>();

            switch (status.StatusType)
            {
                case PublishStatusType.Success:
                case PublishStatusType.SuccessAlreadyPublished:
                    messages.Add(
                        new EventMessage(
                            textService.Localize("speechBubbles/editContentPublishedHeader"),
                            status.ContentItem.ExpireDate.HasValue
                                ? textService.Localize("speechBubbles/editContentPublishedWithExpireDateText", new[] { status.ContentItem.ExpireDate.Value.ToLongDateString(), status.ContentItem.ExpireDate.Value.ToShortTimeString() })
                                : textService.Localize("speechBubbles/editContentPublishedText")
                            ));
                    break;
                case PublishStatusType.FailedPathNotPublished:
                    messages.Add(
                        new EventMessage(
                            textService.Localize("publish"),
                            textService.Localize("publish/contentPublishedFailedByParent",
                                new[] { string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id) }).Trim(),
                            EventMessageType.Warning));
                    break;
                case PublishStatusType.FailedCancelledByEvent:
                    if (status.EventMessages.Count == 0) // only show default cancel notification if one wasn't already added
                    {
                        messages.Add(
                            new EventMessage(textService.Localize("publish"),
                                textService.Localize("speechBubbles/contentPublishedFailedByEvent"),
                                EventMessageType.Warning));
                    }
                    break;
                case PublishStatusType.FailedAwaitingRelease:
                    messages.Add(new EventMessage(
                        textService.Localize("publish"),
                        textService.Localize("publish/contentPublishedFailedAwaitingRelease",
                            new[] { string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id) }).Trim(),
                        EventMessageType.Warning));
                    break;
                case PublishStatusType.FailedHasExpired:
                    messages.Add(new EventMessage(
                        textService.Localize("publish"),
                        textService.Localize("publish/contentPublishedFailedExpired",
                            new[]
                            {
                                string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id),
                            }).Trim(),
                        EventMessageType.Warning));
                    break;
                case PublishStatusType.FailedIsTrashed:
                    //TODO: We should add proper error messaging for this!
                    break;
                case PublishStatusType.FailedContentInvalid:
                    messages.Add(new EventMessage(
                        textService.Localize("publish"),
                        textService.Localize("publish/contentPublishedFailedInvalid",
                            new[]
                            {
                                string.Format("{0} ({1})", status.ContentItem.Name, status.ContentItem.Id),
                                string.Join(",", status.InvalidProperties.Select(x => x.Alias))
                            }).Trim(),
                        EventMessageType.Warning));
                    break;
            }

            return messages;
        }
예제 #23
0
        /// <summary>
        /// Returns the login property display field
        /// </summary>
        /// <param name="memberService"></param>
        /// <param name="member"></param>
        /// <param name="display"></param>
        /// <param name="localizedText"></param>
        /// <returns></returns>
        /// <remarks>
        /// If the membership provider installed is the umbraco membership provider, then we will allow changing the username, however if
        /// the membership provider is a custom one, we cannot allow chaning the username because MembershipProvider's do not actually natively
        /// allow that.
        /// </remarks>
        internal static ContentPropertyDisplay GetLoginProperty(IMemberService memberService, IMember member, ILocalizedTextService localizedText)
        {
            var prop = new ContentPropertyDisplay
            {
                Alias = $"{Constants.PropertyEditors.InternalGenericPropertiesPrefix}login",
                Label = localizedText.Localize("login"),
                Value = member.Username
            };

            var scenario = memberService.GetMembershipScenario();

            //only allow editing if this is a new member, or if the membership provider is the umbraco one
            if (member.HasIdentity == false || scenario == MembershipScenario.NativeUmbraco)
            {
                prop.View = "textbox";
                prop.Validation.Mandatory = true;
            }
            else
            {
                prop.View = "readonlyvalue";
            }
            return(prop);
        }
예제 #24
0
 public FolderAndFilePermissionsCheck(ILocalizedTextService textService)
 {
     _textService = textService;
 }
예제 #25
0
 protected AbstractConfigCheck(ILocalizedTextService textService)
 {
     TextService           = textService;
     _configurationService = new ConfigurationService(AbsoluteFilePath, XPath, textService);
 }
예제 #26
0
 public PropertyValidationService(PropertyEditorCollection propertyEditors, IDataTypeService dataTypeService, ILocalizedTextService textService)
 {
     _propertyEditors = propertyEditors;
     _dataTypeService = dataTypeService;
     _textService     = textService;
 }
예제 #27
0
 protected TabsAndPropertiesMapper(ILocalizedTextService localizedTextService)
     : this(localizedTextService, new List <string>())
 {
 }
예제 #28
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ClickJackingCheck" /> class.
 /// </summary>
 public ClickJackingCheck(IHostingEnvironment hostingEnvironment, ILocalizedTextService textService)
     : base(hostingEnvironment, textService, "X-Frame-Options", "clickJacking", true)
 {
 }
예제 #29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MerchelloTreeController"/> class.
        /// </summary>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <exception cref="NullReferenceException">
        /// Throws a null reference exception if the Umbraco ApplicationContent is null
        /// </exception>
        public MerchelloTreeController(UmbracoContext context)
        {
            if (ApplicationContext == null) throw new NullReferenceException("Umbraco ApplicationContent is null");
            Mandate.ParameterNotNull(context, "context");

            //// http://issues.merchello.com/youtrack/issue/M-732
            _textService = ApplicationContext.Services.TextService;

            _culture = LocalizationHelper.GetCultureFromUser(context.Security.CurrentUser);

            _rootTrees = MerchelloConfiguration.Current.BackOffice.GetTrees().Where(x => x.Visible).ToArray();
        }
예제 #30
0
 protected TabsAndPropertiesMapper(ILocalizedTextService localizedTextService, IEnumerable <string> ignoreProperties)
 {
     LocalizedTextService = localizedTextService ?? throw new ArgumentNullException(nameof(localizedTextService));
     IgnoreProperties     = ignoreProperties ?? throw new ArgumentNullException(nameof(ignoreProperties));
 }
예제 #31
0
 // The check is mostly based on the instructions in the OWASP CheatSheet
 // (https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet)
 // and the blogpost of Troy Hunt (https://www.troyhunt.com/understanding-http-strict-transport/)
 // If you want do to it perfectly, you have to submit it https://hstspreload.appspot.com/,
 // but then you should include subdomains and I wouldn't suggest to do that for Umbraco-sites.
 public XssProtectionCheck(IRuntimeState runtime, ILocalizedTextService textService)
     : base(runtime, textService, "X-XSS-Protection", "1; mode=block", "xssProtection", true)
 {
 }
 public ExamineRebuildOnStartupCheck(HealthCheckContext healthCheckContext) : base(healthCheckContext)
 {
     TextService = healthCheckContext.ApplicationContext.Services.TextService;
 }
 public SchedulerTreeController()
 {
     _textService = ApplicationContext.Services.TextService;
     _schedulerApi = new SchedulerApiController();
 }