コード例 #1
0
ファイル: BackOfficeModel.cs プロジェクト: swedishkid/umbraco
 public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings, IIconService iconService)
 {
     Features       = features;
     GlobalSettings = globalSettings;
     IconCheckData  = iconService.GetIcon("icon-check")?.SvgString;
     IconDeleteData = iconService.GetIcon("icon-delete")?.SvgString;
 }
コード例 #2
0
 public BackOfficeController(ManifestParser manifestParser, UmbracoFeatures features, IGlobalSettings globalSettings, UmbracoContext umbracoContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, IProfilingLogger profilingLogger, IRuntimeState runtimeState)
     : base(globalSettings, umbracoContext, services, applicationCache, logger, profilingLogger)
 {
     _manifestParser = manifestParser;
     _features       = features;
     _runtimeState   = runtimeState;
 }
コード例 #3
0
 public BackOfficeController(ManifestParser manifestParser, UmbracoFeatures features, IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ServiceContext services, AppCaches appCaches, IProfilingLogger profilingLogger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper)
     : base(globalSettings, umbracoContextAccessor, services, appCaches, profilingLogger, umbracoHelper)
 {
     _manifestParser = manifestParser;
     _features       = features;
     _runtimeState   = runtimeState;
 }
コード例 #4
0
    /// <summary>
    ///     Initializes a new instance of the <see cref="UmbracoRouteValuesFactory" /> class.
    /// </summary>
    public UmbracoRouteValuesFactory(
        IOptions <UmbracoRenderingDefaultsOptions> renderingDefaults,
        IShortStringHelper shortStringHelper,
        UmbracoFeatures umbracoFeatures,
        IControllerActionSearcher controllerActionSearcher,
        IPublishedRouter publishedRouter)
    {
        _shortStringHelper        = shortStringHelper;
        _umbracoFeatures          = umbracoFeatures;
        _controllerActionSearcher = controllerActionSearcher;
        _publishedRouter          = publishedRouter;
        _defaultControllerName    = new Lazy <string>(() =>
                                                      ControllerExtensions.GetControllerName(renderingDefaults.Value.DefaultControllerType));
        _defaultControllerDescriptor = new Lazy <ControllerActionDescriptor>(() =>
        {
            ControllerActionDescriptor?descriptor = _controllerActionSearcher.Find <IRenderController>(
                new DefaultHttpContext(), // this actually makes no difference for this method
                DefaultControllerName,
                UmbracoRouteValues.DefaultActionName);

            if (descriptor == null)
            {
                throw new InvalidOperationException(
                    $"No controller/action found by name {DefaultControllerName}.{UmbracoRouteValues.DefaultActionName}");
            }

            return(descriptor);
        });
    }
コード例 #5
0
 public BackOfficePreviewModel(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IEnumerable <ILanguage> languages)
     : this(features, globalSettings, languages, Current.IconService)
 {
 }
コード例 #6
0
 public PreviewController(UmbracoFeatures features, IGlobalSettings globalSettings, IPublishedSnapshotService publishedSnapshotService, UmbracoContext umbracoContext)
 {
     _features                 = features;
     _globalSettings           = globalSettings;
     _publishedSnapshotService = publishedSnapshotService;
     _umbracoContext           = umbracoContext;
 }
コード例 #7
0
 internal BackOfficeServerVariables(UrlHelper urlHelper, IRuntimeState runtimeState, UmbracoFeatures features, IGlobalSettings globalSettings)
 {
     _urlHelper      = urlHelper;
     _runtimeState   = runtimeState;
     _features       = features;
     _globalSettings = globalSettings;
     _httpContext    = _urlHelper.RequestContext.HttpContext;
     _owinContext    = _httpContext.GetOwinContext();
 }
コード例 #8
0
 public BackOfficePreviewModel(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IEnumerable <ILanguage> languages)
     : base(features, globalSettings)
 {
     _features = features;
     Languages = languages;
 }
コード例 #9
0
 public PreviewController(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IPublishedSnapshotService publishedSnapshotService,
     IUmbracoContextAccessor umbracoContextAccessor,
     ILocalizationService localizationService)
 {
     _features                 = features;
     _globalSettings           = globalSettings;
     _publishedSnapshotService = publishedSnapshotService;
     _umbracoContextAccessor   = umbracoContextAccessor;
     _localizationService      = localizationService;
 }
コード例 #10
0
 public PreviewController(
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IPublishedSnapshotService publishedSnapshotService,
     IUmbracoContextAccessor umbracoContextAccessor,
     ILocalizationService localizationService)
     : this(features,
            globalSettings,
            publishedSnapshotService,
            umbracoContextAccessor,
            localizationService,
            Current.IconService)
 {
 }
コード例 #11
0
        public BackOfficeServerVariables(
            LinkGenerator linkGenerator,
            IRuntimeState runtimeState,
            UmbracoFeatures features,
            IOptionsMonitor <GlobalSettings> globalSettings,
            IUmbracoVersion umbracoVersion,
            IOptionsMonitor <ContentSettings> contentSettings,
            IHttpContextAccessor httpContextAccessor,
            TreeCollection treeCollection,
            IHostingEnvironment hostingEnvironment,
            IOptionsMonitor <RuntimeSettings> runtimeSettings,
            IOptionsMonitor <SecuritySettings> securitySettings,
            IRuntimeMinifier runtimeMinifier,
            IBackOfficeExternalLoginProviders externalLogins,
            IImageUrlGenerator imageUrlGenerator,
            PreviewRoutes previewRoutes,
            IEmailSender emailSender,
            IOptionsMonitor <MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings,
            IOptionsMonitor <DataTypesSettings> dataTypesSettings)
        {
            _linkGenerator       = linkGenerator;
            _runtimeState        = runtimeState;
            _features            = features;
            _globalSettings      = globalSettings.CurrentValue;
            _umbracoVersion      = umbracoVersion;
            _contentSettings     = contentSettings.CurrentValue ?? throw new ArgumentNullException(nameof(contentSettings));
            _httpContextAccessor = httpContextAccessor;
            _treeCollection      = treeCollection ?? throw new ArgumentNullException(nameof(treeCollection));
            _hostingEnvironment  = hostingEnvironment;
            _runtimeSettings     = runtimeSettings.CurrentValue;
            _securitySettings    = securitySettings.CurrentValue;
            _runtimeMinifier     = runtimeMinifier;
            _externalLogins      = externalLogins;
            _imageUrlGenerator   = imageUrlGenerator;
            _previewRoutes       = previewRoutes;
            _emailSender         = emailSender;
            _memberPasswordConfigurationSettings = memberPasswordConfigurationSettings.CurrentValue;
            _dataTypesSettings = dataTypesSettings.CurrentValue;

            globalSettings.OnChange(x => _globalSettings       = x);
            contentSettings.OnChange(x => _contentSettings     = x);
            runtimeSettings.OnChange(x => _runtimeSettings     = x);
            securitySettings.OnChange(x => _securitySettings   = x);
            dataTypesSettings.OnChange(x => _dataTypesSettings = x);
            memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x);
        }
コード例 #12
0
 public BackOfficeController(
     ManifestParser manifestParser,
     UmbracoFeatures features,
     IGlobalSettings globalSettings,
     IUmbracoContextAccessor umbracoContextAccessor,
     ServiceContext services,
     AppCaches appCaches,
     IProfilingLogger profilingLogger,
     IRuntimeState runtimeState,
     UmbracoHelper umbracoHelper)
     : this(manifestParser,
            features,
            globalSettings,
            umbracoContextAccessor,
            services,
            appCaches,
            profilingLogger,
            runtimeState,
            umbracoHelper,
            Current.IconService)
 {
 }
コード例 #13
0
 public BackOfficeServerVariables(
     LinkGenerator linkGenerator,
     IRuntimeState runtimeState,
     UmbracoFeatures features,
     IOptionsMonitor <GlobalSettings> globalSettings,
     IUmbracoVersion umbracoVersion,
     IOptionsMonitor <ContentSettings> contentSettings,
     IHttpContextAccessor httpContextAccessor,
     TreeCollection treeCollection,
     IHostingEnvironment hostingEnvironment,
     IOptionsMonitor <RuntimeSettings> runtimeSettings,
     IOptionsMonitor <SecuritySettings> securitySettings,
     IRuntimeMinifier runtimeMinifier,
     IBackOfficeExternalLoginProviders externalLogins,
     IImageUrlGenerator imageUrlGenerator,
     PreviewRoutes previewRoutes,
     IEmailSender emailSender,
     IOptionsMonitor <MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings)
     : this(
         linkGenerator,
         runtimeState,
         features,
         globalSettings,
         umbracoVersion,
         contentSettings,
         httpContextAccessor,
         treeCollection,
         hostingEnvironment,
         runtimeSettings,
         securitySettings,
         runtimeMinifier,
         externalLogins,
         imageUrlGenerator,
         previewRoutes,
         emailSender,
         memberPasswordConfigurationSettings,
         StaticServiceProvider.Instance.GetRequiredService <IOptionsMonitor <DataTypesSettings> >())
 {
 }
コード例 #14
0
 public PreviewController(
     UmbracoFeatures features,
     IOptionsSnapshot <GlobalSettings> globalSettings,
     IPublishedSnapshotService publishedSnapshotService,
     IBackOfficeSecurityAccessor backofficeSecurityAccessor,
     ILocalizationService localizationService,
     IHostingEnvironment hostingEnvironment,
     ICookieManager cookieManager,
     IRuntimeMinifier runtimeMinifier,
     ICompositeViewEngine viewEngines,
     IUmbracoContextAccessor umbracoContextAccessor)
 {
     _features                   = features;
     _globalSettings             = globalSettings.Value;
     _publishedSnapshotService   = publishedSnapshotService;
     _backofficeSecurityAccessor = backofficeSecurityAccessor;
     _localizationService        = localizationService;
     _hostingEnvironment         = hostingEnvironment;
     _cookieManager              = cookieManager;
     _runtimeMinifier            = runtimeMinifier;
     _viewEngines                = viewEngines;
     _umbracoContextAccessor     = umbracoContextAccessor;
 }
コード例 #15
0
 public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings)
 {
     Features       = features;
     GlobalSettings = globalSettings;
 }
コード例 #16
0
 public DisabledModelsBuilderComponent(UmbracoFeatures features)
 {
     _features = features;
 }
コード例 #17
0
 public FeatureAuthorizeHandler(UmbracoFeatures umbracoFeatures)
 {
     _umbracoFeatures = umbracoFeatures;
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatureAuthorizeAttribute"/> class.
 /// </summary>
 public FeatureAuthorizeAttribute()
 {
     // attributes have to use Current.Container
     _features = Current.Factory?.TryGetInstance <UmbracoFeatures>();
 }
コード例 #19
0
ファイル: BackOfficeModel.cs プロジェクト: swedishkid/umbraco
 public BackOfficeModel(UmbracoFeatures features, IGlobalSettings globalSettings) : this(features, globalSettings, Current.IconService)
 {
 }
コード例 #20
0
 public BackOfficePreviewModel(UmbracoFeatures features, IEnumerable <ILanguage> languages)
 {
     _features = features;
     Languages = languages;
 }
コード例 #21
0
 public DisableModelsBuilderNotificationHandler(UmbracoFeatures features) => _features = features;
コード例 #22
0
        /// <summary>
        /// Outputs a script tag containing the bare minimum (non secure) server vars for use with the angular app
        /// </summary>
        /// <param name="html"></param>
        /// <param name="uri"></param>
        /// <param name="externalLoginsUrl">
        /// The post url used to sign in with external logins - this can change depending on for what service the external login is service.
        /// Example: normal back office login or authenticating upgrade login
        /// </param>
        /// <param name="features"></param>
        /// <param name="globalSettings"></param>
        /// <returns></returns>
        /// <remarks>
        /// These are the bare minimal server variables that are required for the application to start without being authenticated,
        /// we will load the rest of the server vars after the user is authenticated.
        /// </remarks>
        public static IHtmlString BareMinimumServerVariablesScript(this HtmlHelper html, UrlHelper uri, string externalLoginsUrl, UmbracoFeatures features, IGlobalSettings globalSettings)
        {
            var serverVars = new BackOfficeServerVariables(uri, Current.RuntimeState, features, globalSettings);
            var minVars    = serverVars.BareMinimumServerVariables();

            var str = @"<script type=""text/javascript"">
                var Umbraco = {};
                Umbraco.Sys = {};
                Umbraco.Sys.ServerVariables = " + JsonConvert.SerializeObject(minVars) + @";
            </script>";

            return(html.Raw(str));
        }
コード例 #23
0
 public BackOfficePreviewModel(UmbracoFeatures features, IGlobalSettings globalSettings) : base(features, globalSettings)
 {
 }