当前位置: 首页>>代码示例>>C#>>正文


C# Models.SiteSettings类代码示例

本文整理汇总了C#中cloudscribe.Core.Models.SiteSettings的典型用法代码示例。如果您正苦于以下问题:C# SiteSettings类的具体用法?C# SiteSettings怎么用?C# SiteSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SiteSettings类属于cloudscribe.Core.Models命名空间,在下文中一共展示了SiteSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FolderTenantNodeUrlPrefixProvider

 public FolderTenantNodeUrlPrefixProvider(
     SiteSettings currentSite,
     IOptions<MultiTenantOptions> multiTenantOptions)
 {
     site = currentSite;
     options = multiTenantOptions.Value;
 }
开发者ID:ReinhardHsu,项目名称:cloudscribe,代码行数:7,代码来源:FolderTenantNodeUrlPrefixProvider.cs

示例2: CoreDataController

 public CoreDataController(
     SiteSettings currentSite,
     GeoDataManager geoDataManager,
     IOptions<UIOptions> uiOptionsAccessor
     )
 {
     Site = currentSite; 
     dataManager = geoDataManager;
     uiOptions = uiOptionsAccessor.Value;
 }
开发者ID:lespera,项目名称:cloudscribe,代码行数:10,代码来源:CoreDataController.cs

示例3: MultiTenantCookieOptionsResolver

 public MultiTenantCookieOptionsResolver(
     //ISiteResolver siteResolver,
     SiteSettings currentSite,
     IOptions<MultiTenantOptions> multiTenantOptions,
     ILoggerFactory loggerFactory)
 {
     site = currentSite;
     //this.siteResolver = siteResolver;
     this.multiTenantOptions = multiTenantOptions.Value;
     log = loggerFactory.CreateLogger<MultiTenantCookieOptionsResolver>();
 }
开发者ID:lespera,项目名称:cloudscribe,代码行数:11,代码来源:MultiTenantCookieOptionsResolver.cs

示例4: MultiTenantCookieOptionsResolverFactory

 public MultiTenantCookieOptionsResolverFactory(
     //ISiteResolver siteResolver,
     SiteSettings currentSite,
     IOptions<MultiTenantOptions> multiTenantOptions,
     ILoggerFactory loggerFactory)
 {
     //this.siteResolver = siteResolver;
     this.currentSite = currentSite;
     this.multiTenantOptions = multiTenantOptions;
     this.loggerFactory = loggerFactory;
 }
开发者ID:lespera,项目名称:cloudscribe,代码行数:11,代码来源:MultiTenantCookieOptionsResolverFactory.cs

示例5: CoreDataController

 public CoreDataController(
     SiteSettings currentSite,
     GeoDataManager geoDataManager,
     IStringLocalizer<CloudscribeCore> localizer,
     IOptions<UIOptions> uiOptionsAccessor
     )
 {
     Site = currentSite; 
     dataManager = geoDataManager;
     uiOptions = uiOptionsAccessor.Value;
     sr = localizer;
 }
开发者ID:ReinhardHsu,项目名称:cloudscribe,代码行数:12,代码来源:CoreDataController.cs

示例6: TenantLayoutSelector

        public TenantLayoutSelector(
            IRazorViewEngine viewEngine,
            SiteSettings currentSite,
            IOptions<LayoutSelectorOptions> layoutOptionsAccesor,
            ILogger<TenantLayoutSelector> logger)
        {
            if (viewEngine == null) { throw new ArgumentNullException(nameof(viewEngine)); }
            if (currentSite == null) { throw new ArgumentNullException(nameof(currentSite)); }
            if (logger == null) { throw new ArgumentNullException(nameof(logger)); }
            if (layoutOptionsAccesor == null) { throw new ArgumentNullException(nameof(layoutOptionsAccesor)); }

            this.viewEngine = viewEngine;
            site = currentSite;
            options = layoutOptionsAccesor.Value;
            log = logger;
        }
开发者ID:lespera,项目名称:cloudscribe,代码行数:16,代码来源:TenantLayoutSelector.cs

示例7: AccountController

 public AccountController(
     SiteSettings currentSite,
     SiteUserManager<SiteUser> userManager,
     SiteSignInManager<SiteUser> signInManager,
     IpAddressTracker ipAddressTracker,
     ISiteMessageEmailSender emailSender,
     ISmsSender smsSender,
     ILogger<AccountController> logger)
 {
     Site = currentSite; 
     this.userManager = userManager;
     this.signInManager = signInManager;
     this.emailSender = emailSender;
     this.smsSender = smsSender;
     this.ipAddressTracker = ipAddressTracker;
     log = logger;
 }
开发者ID:lespera,项目名称:cloudscribe,代码行数:17,代码来源:AccountController.cs

示例8: ManageController

 public ManageController(
     SiteSettings currentSite,
     SiteUserManager<SiteUser> userManager,
     SiteSignInManager<SiteUser> signInManager,
     ISmsSender smsSender,
     IStringLocalizer<CloudscribeCore> localizer,
     ITimeZoneIdResolver timeZoneIdResolver,
     ITimeZoneHelper timeZoneHelper
     )
 {
     Site = currentSite; 
     this.userManager = userManager;
     this.signInManager = signInManager;
    // this.emailSender = emailSender;
     this.smsSender = smsSender;
     sr = localizer;
     this.timeZoneIdResolver = timeZoneIdResolver;
     tzHelper = timeZoneHelper;
 }
开发者ID:ReinhardHsu,项目名称:cloudscribe,代码行数:19,代码来源:ManageController.cs

示例9: BuildInitialSite

        public static SiteSettings BuildInitialSite()
        {
            var newSite = new SiteSettings();
            newSite.SiteName = "Sample Site";
            newSite.AliasId = "s1";
            newSite.IsServerAdminSite = true;
            newSite.Theme = "default";
            newSite.AllowNewRegistration = true;
            newSite.AutoCreateLdapUserOnFirstLogin = true;
            newSite.ReallyDeleteUsers = true;
            newSite.LdapPort = 389;
            newSite.LdapRootDN = string.Empty;
            newSite.LdapServer = string.Empty;
            newSite.UseEmailForLogin = true;
            newSite.UseLdapAuth = false;
            newSite.RequireConfirmedEmail = false;
            newSite.RequiresQuestionAndAnswer = false;
            newSite.MaxInvalidPasswordAttempts = 10;
            newSite.MinRequiredPasswordLength = 7;

            return newSite;
        }
开发者ID:joeaudette,项目名称:cloudscribe,代码行数:22,代码来源:InitialData.cs

示例10: SiteManager

        public SiteManager(
            SiteSettings currentSite,
            ISiteRepository siteRepository,
            IUserRepository userRepository,
            SiteDataProtector dataProtector,
            IHttpContextAccessor contextAccessor,
            ILogger<SiteManager> logger,
            IOptions<MultiTenantOptions> multiTenantOptionsAccessor,
            IOptions<SiteConfigOptions> setupOptionsAccessor
            )
        {
            
            siteRepo = siteRepository;
            userRepo = userRepository;
            multiTenantOptions = multiTenantOptionsAccessor.Value;
            setupOptions = setupOptionsAccessor.Value;
            _context = contextAccessor?.HttpContext;
            this.dataProtector = dataProtector;
            log = logger;

            //resolver = siteResolver;
            siteSettings = currentSite;
        }
开发者ID:lespera,项目名称:cloudscribe,代码行数:23,代码来源:SiteManager.cs

示例11: FromISiteSettings

        //public bool UseSslOnAllPages { get; set; } = false;

        //public int PasswordAttemptWindowMinutes { get; set; } = 5;
        //public int MinReqNonAlphaChars { get; set; } = 0;

        //public bool RequireEnterEmailTwiceOnRegistration { get; set; } = false;

        //public bool AllowUserFullNameChange { get; set; } = true;

        //private string apiKeyExtra1 = string.Empty;
        //public string ApiKeyExtra1
        //{
        //    get { return apiKeyExtra1 ?? string.Empty; }
        //    set { apiKeyExtra1 = value; }
        //}

        //private string apiKeyExtra2 = string.Empty;
        //public string ApiKeyExtra2
        //{
        //    get { return apiKeyExtra2 ?? string.Empty; }
        //    set { apiKeyExtra2 = value; }
        //}

        //private string apiKeyExtra3 = string.Empty;
        //public string ApiKeyExtra3
        //{
        //    get { return apiKeyExtra3 ?? string.Empty; }
        //    set { apiKeyExtra3 = value; }
        //}

        //private string apiKeyExtra4 = string.Empty;
        //public string ApiKeyExtra4
        //{
        //    get { return apiKeyExtra4 ?? string.Empty; }
        //    set { apiKeyExtra4 = value; }
        //}

        //private string apiKeyExtra5 = string.Empty;
        //public string ApiKeyExtra5
        //{
        //    get { return apiKeyExtra5 ?? string.Empty; }
        //    set { apiKeyExtra5 = value; }
        //}


        public static SiteSettings FromISiteSettings(ISiteSettings i)
        {
            if(i == null) { return null; }

            SiteSettings s = new SiteSettings();
            s.ConcurrencyStamp = i.ConcurrencyStamp;
            s.AccountApprovalEmailCsv = i.AccountApprovalEmailCsv;
            s.AddThisDotComUsername = i.AddThisDotComUsername;
            s.AllowDbFallbackWithLdap = i.AllowDbFallbackWithLdap;
            s.AllowNewRegistration = i.AllowNewRegistration;
            s.AllowPersistentLogin = i.AllowPersistentLogin;
            s.AutoCreateLdapUserOnFirstLogin = i.AutoCreateLdapUserOnFirstLogin;
            s.CaptchaOnLogin = i.CaptchaOnLogin;
            s.CaptchaOnRegistration = i.CaptchaOnRegistration;
            s.CompanyCountry = i.CompanyCountry;
            s.CompanyFax = i.CompanyFax;
            s.CompanyLocality = i.CompanyLocality;
            s.CompanyName = i.CompanyName;
            s.CompanyPhone = i.CompanyPhone;
            s.CompanyPostalCode = i.CompanyPostalCode;
            s.CompanyPublicEmail = i.CompanyPublicEmail;
            s.CompanyRegion = i.CompanyRegion;
            s.CompanyStreetAddress = i.CompanyStreetAddress;
            s.CompanyStreetAddress2 = i.CompanyStreetAddress2;
            s.CreatedUtc = i.CreatedUtc;
            s.DefaultEmailFromAddress = i.DefaultEmailFromAddress;
            s.DefaultEmailFromAlias = i.DefaultEmailFromAlias;
            s.DisableDbAuth = i.DisableDbAuth;
            s.DkimPublicKey = i.DkimPublicKey;
            s.DkimPrivateKey = i.DkimPrivateKey;
            s.DkimDomain = i.DkimDomain;
            s.DkimSelector = i.DkimSelector;
            s.EmailLdapDbFallback = i.EmailLdapDbFallback;
            s.FacebookAppId = i.FacebookAppId;
            s.FacebookAppSecret = i.FacebookAppSecret;
            s.GoogleAnalyticsProfileId = i.GoogleAnalyticsProfileId;
            s.GoogleClientId = i.GoogleClientId;
            s.GoogleClientSecret = i.GoogleClientSecret;
            s.IsDataProtected = i.IsDataProtected;
            s.IsServerAdminSite = i.IsServerAdminSite;
            s.Theme = i.Theme;
            s.LdapDomain = i.LdapDomain;
            s.LdapPort = i.LdapPort;
            s.LdapRootDN = i.LdapRootDN;
            s.LdapServer = i.LdapServer;
            s.LdapUserDNKey = i.LdapUserDNKey;
            s.LoginInfoBottom = i.LoginInfoBottom;
            s.LoginInfoTop = i.LoginInfoTop;
            s.MaxInvalidPasswordAttempts = i.MaxInvalidPasswordAttempts;
            s.MicrosoftClientId = i.MicrosoftClientId;
            s.MicrosoftClientSecret = i.MicrosoftClientSecret;
            s.MinRequiredPasswordLength = i.MinRequiredPasswordLength;
            s.OidConnectAppId = i.OidConnectAppId;
            s.OidConnectAppSecret = i.OidConnectAppSecret;
            s.PreferredHostName = i.PreferredHostName;
//.........这里部分代码省略.........
开发者ID:joeaudette,项目名称:cloudscribe,代码行数:101,代码来源:SiteSettings.cs

示例12: Fetch

        public async Task<ISiteSettings> Fetch(
            string hostName, 
            CancellationToken cancellationToken = default(CancellationToken))
        {
            cancellationToken.ThrowIfCancellationRequested();
            SiteSettings site = new SiteSettings();

            using (DbDataReader reader = await dbSiteSettings.GetSite(
                hostName,
                cancellationToken))
            {
                if (reader.Read())
                {
                    site.LoadFromReader(reader);
                }
            }

            if (site.SiteGuid == Guid.Empty) { return null; }//not found 

            //TODO: unless we also need a synchronous version of this method 
            // the below should be made async
            //List<ExpandoSetting> expandoProperties = GetExpandoProperties(site.SiteId);
            //site.LoadExpandoSettings(expandoProperties);

            return site;

        }
开发者ID:joeaudette,项目名称:cloudscribe.Core.Data,代码行数:27,代码来源:SiteRepository.cs

示例13: CreateRequiredRolesAndAdminUser

 public async Task CreateRequiredRolesAndAdminUser(SiteSettings site)
 {
     await EnsureRequiredRoles(site);
     await CreateAdminUser(site);
     
 }
开发者ID:joeaudette,项目名称:cloudscribe,代码行数:6,代码来源:SiteManager.cs

示例14: NewSite

        public async Task<ActionResult> NewSite(SiteBasicSettingsViewModel model)
        {
            ViewData["Title"] = "Create New Site";

            if (!ModelState.IsValid)
            {
                return View(model);
            }
            
            bool addHostName = false;

            if (multiTenantOptions.Mode == MultiTenantMode.FolderName)
            {
                if (string.IsNullOrEmpty(model.SiteFolderName))
                {
                    ModelState.AddModelError("foldererror", "Folder name is required.");

                    return View(model);
                }

                SiteFolder folder = await siteManager.GetSiteFolder(model.SiteFolderName);
                if (folder != null)
                {
                    ModelState.AddModelError("foldererror", "The selected folder name is already in use on another site.");

                    return View(model);
                }

            }
            else
            {
                ISiteHost host;

                if (!string.IsNullOrEmpty(model.HostName))
                {
                    model.HostName = model.HostName.Replace("https://", string.Empty).Replace("http://", string.Empty);

                    host = await siteManager.GetSiteHost(model.HostName);

                    if (host != null)
                    {

                        ModelState.AddModelError("hosterror", "The selected host/domain name is already in use on another site.");

                        return View(model);

                    }

                    addHostName = true;
                }




            }

            SiteSettings newSite = new SiteSettings();

            // only the first site created by setup page should be a server admin site
            newSite.IsServerAdminSite = false;

            newSite.SiteName = model.SiteName;
            
            if (multiTenantOptions.Mode == MultiTenantMode.FolderName)
            {
                newSite.SiteFolderName = model.SiteFolderName;
            }
            else if (addHostName)
            {
                newSite.PreferredHostName = model.HostName;
            }

            newSite.SiteIsClosed = model.IsClosed;
            newSite.SiteIsClosedMessage = model.ClosedMessage;
            
            //Site.SiteRepository.Save(newSite);
            bool result = await siteManager.CreateNewSite(newSite);
            result = await siteManager.CreateRequiredRolesAndAdminUser(newSite);

            if ((result) && (multiTenantOptions.Mode == MultiTenantMode.FolderName))
            {
                bool folderResult = await siteManager.EnsureSiteFolder(newSite);

            // for folder sites we need routes that match the folder
            // which are normally created during app startup
            // can we add routes here? or do we need to force the app to recycle?
            // this seems to work, but we really do need to restart
            // so that the per folder authentication gets setup too
            //cloudscribe.Web.Routing.RouteRegistrar.AddDefaultRouteForNewSiteFolder(folder.FolderName);

            //startup.TriggerStartup();
            //http://stackoverflow.com/questions/31339896/replacement-httpruntime-unloadappdomain-in-asp-net-5

            }

            if (result && addHostName)
            {
                bool hostResult = await siteManager.AddHost(
                            newSite.SiteGuid,
                            newSite.SiteId,
//.........这里部分代码省略.........
开发者ID:freemsly,项目名称:cloudscribe,代码行数:101,代码来源:SiteAdminController.cs

示例15: NewSite

        public async Task<ActionResult> NewSite(NewSiteViewModel model)
        {
            ViewData["Title"] = "Create New Site";

            if (!ModelState.IsValid)
            {
                return View(model);
            }
            
            bool addHostName = false;
            var newSite = new SiteSettings();
            newSite.Id = Guid.NewGuid();

            if (multiTenantOptions.Mode == MultiTenantMode.FolderName)
            {
                if (string.IsNullOrEmpty(model.SiteFolderName))
                {
                    model.AllTimeZones = tzHelper.GetTimeZoneList().Select(x =>
                               new SelectListItem
                               {
                                   Text = x,
                                   Value = x,
                                   Selected = model.TimeZoneId == x
                               });
                    ModelState.AddModelError("foldererror", sr["Folder name is required."]);
                    return View(model);
                }

                bool folderAvailable = await siteManager.FolderNameIsAvailable(newSite.Id, model.SiteFolderName);
                if (!folderAvailable)
                {
                    model.AllTimeZones = tzHelper.GetTimeZoneList().Select(x =>
                               new SelectListItem
                               {
                                   Text = x,
                                   Value = x,
                                   Selected = model.TimeZoneId == x
                               });
                    ModelState.AddModelError("foldererror", sr["The selected folder name is already in use on another site."]);
                    return View(model);
                }
            }
            else
            {
                ISiteHost host;
                if (!string.IsNullOrEmpty(model.HostName))
                {
                    model.HostName = model.HostName.Replace("https://", string.Empty).Replace("http://", string.Empty);
                    host = await siteManager.GetSiteHost(model.HostName);
                    if (host != null)
                    {
                        model.AllTimeZones = tzHelper.GetTimeZoneList().Select(x =>
                               new SelectListItem
                               {
                                   Text = x,
                                   Value = x,
                                   Selected = model.TimeZoneId == x
                               });
                        ModelState.AddModelError("hosterror", sr["The selected host/domain name is already in use on another site."]);
                        return View(model);
                    }
                    addHostName = true;
                }

            }
            
            // only the first site created by setup page should be a server admin site
            newSite.IsServerAdminSite = false;
            newSite.SiteName = model.SiteName;
            
            var siteNumber = 1 + await siteManager.CountOtherSites(Guid.Empty);
            newSite.AliasId = $"s{siteNumber}";
            

            if (multiTenantOptions.Mode == MultiTenantMode.FolderName)
            {
                newSite.SiteFolderName = model.SiteFolderName;
            }
            else if (addHostName)
            {
                newSite.PreferredHostName = model.HostName;
            }

            newSite.SiteIsClosed = model.IsClosed;
            newSite.SiteIsClosedMessage = model.ClosedMessage;
            
            await siteManager.CreateNewSite(newSite);
            await siteManager.CreateRequiredRolesAndAdminUser(
                newSite,
                model.Email,
                model.LoginName,
                model.DisplayName,
                model.Password
                );
            
            if (addHostName)
            {
                await siteManager.AddHost(newSite.Id, model.HostName);
            }
            
//.........这里部分代码省略.........
开发者ID:joeaudette,项目名称:cloudscribe,代码行数:101,代码来源:SiteAdminController.cs


注:本文中的cloudscribe.Core.Models.SiteSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。