本文整理汇总了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;
}
示例2: CoreDataController
public CoreDataController(
SiteSettings currentSite,
GeoDataManager geoDataManager,
IOptions<UIOptions> uiOptionsAccessor
)
{
Site = currentSite;
dataManager = geoDataManager;
uiOptions = uiOptionsAccessor.Value;
}
示例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>();
}
示例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;
}
示例5: CoreDataController
public CoreDataController(
SiteSettings currentSite,
GeoDataManager geoDataManager,
IStringLocalizer<CloudscribeCore> localizer,
IOptions<UIOptions> uiOptionsAccessor
)
{
Site = currentSite;
dataManager = geoDataManager;
uiOptions = uiOptionsAccessor.Value;
sr = localizer;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
//.........这里部分代码省略.........
示例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;
}
示例13: CreateRequiredRolesAndAdminUser
public async Task CreateRequiredRolesAndAdminUser(SiteSettings site)
{
await EnsureRequiredRoles(site);
await CreateAdminUser(site);
}
示例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,
//.........这里部分代码省略.........
示例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);
}
//.........这里部分代码省略.........