@ -348,10 +348,10 @@ namespace Oqtane.Infrastructure
|
||||
var user = new User
|
||||
{
|
||||
SiteId = site.SiteId,
|
||||
Username = GetInstallationConfig(SettingKeys.HostUserKey, Constants.HostUser),
|
||||
Username = Constants.HostUser,
|
||||
Password = password,
|
||||
Email = email,
|
||||
DisplayName = GetInstallationConfig(SettingKeys.HostUserKey, Constants.HostUser),
|
||||
DisplayName = Constants.HostUser,
|
||||
};
|
||||
CreateHostUser(folders, userRoles, roles, users, identityUserManager, user);
|
||||
tenant.IsInitialized = true;
|
||||
@ -419,6 +419,7 @@ namespace Oqtane.Infrastructure
|
||||
{
|
||||
using (var db = new InstallationContext(connectionString))
|
||||
{
|
||||
|
||||
//check if DbUp was initialized
|
||||
return TableExists(db, "SchemaVersions");
|
||||
}
|
||||
@ -431,6 +432,7 @@ namespace Oqtane.Infrastructure
|
||||
|
||||
public static bool TableExists(DbContext context, string schema, string tableName)
|
||||
{
|
||||
if (!context.Database.CanConnect()) return false;
|
||||
var connection = context.Database.GetDbConnection();
|
||||
|
||||
if (connection.State.Equals(ConnectionState.Closed))
|
||||
|
@ -0,0 +1,47 @@
|
||||
using Oqtane.Models;
|
||||
using Oqtane.Infrastructure;
|
||||
using System.Collections.Generic;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.SiteTemplates
|
||||
{
|
||||
public class EmptySiteTemplate : ISiteTemplate
|
||||
{
|
||||
private readonly IPermissionRepository _permissionRepository;
|
||||
|
||||
public EmptySiteTemplate(IPermissionRepository permissionRepository)
|
||||
{
|
||||
_permissionRepository = permissionRepository;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Empty Site Template"; }
|
||||
}
|
||||
|
||||
public List<PageTemplate> CreateSite(Site site)
|
||||
{
|
||||
List<PageTemplate> _pageTemplates = new List<PageTemplate>();
|
||||
|
||||
_pageTemplates.Add(new PageTemplate
|
||||
{
|
||||
Name = "Home",
|
||||
Parent = "",
|
||||
Path = "",
|
||||
Icon = "home",
|
||||
IsNavigation = true,
|
||||
IsPersonalizable = false,
|
||||
EditMode = false,
|
||||
PagePermissions = _permissionRepository.EncodePermissions( new List<Permission> {
|
||||
new Permission(PermissionNames.View, Constants.AllUsersRole, true),
|
||||
new Permission(PermissionNames.View, Constants.AdminRole, true),
|
||||
new Permission(PermissionNames.Edit, Constants.AdminRole, true)
|
||||
}),
|
||||
PageTemplateModules = new List<PageTemplateModule>()
|
||||
});
|
||||
|
||||
return _pageTemplates;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user