From ccd082f417bb86f48a2e1d917a5f98e0d75f3b56 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Wed, 21 Apr 2010 12:25:23 -0700 Subject: [PATCH 1/3] - Adding the multi-tenancy module. --HG-- branch : dev --- .../Modules/Orchard.MultiTenancy/AdminMenu.cs | 14 ++ .../Controllers/AdminController.cs | 18 +++ .../Modules/Orchard.MultiTenancy/Module.txt | 2 + .../Orchard.MultiTenancy.csproj | 106 ++++++++++++ .../Orchard.MultiTenancy/Permissions.cs | 30 ++++ .../Properties/AssemblyInfo.cs | 35 ++++ .../ViewModels/TenantsListViewModel.cs | 6 + .../Views/Admin/List.aspx | 15 ++ .../Orchard.MultiTenancy/Views/Web.config | 34 ++++ .../Modules/Orchard.MultiTenancy/Web.config | 153 ++++++++++++++++++ .../Controllers/SetupController.cs | 1 + src/Orchard.sln | 7 + 12 files changed, 421 insertions(+) create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/AdminMenu.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Module.txt create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Permissions.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Properties/AssemblyInfo.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/AdminMenu.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/AdminMenu.cs new file mode 100644 index 000000000..cc26ca116 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/AdminMenu.cs @@ -0,0 +1,14 @@ +using Orchard.UI.Navigation; + +namespace Orchard.MultiTenancy { + public class AdminMenu : INavigationProvider { + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + builder.Add("MultiTenancy", "2", + menu => menu + .Add("Manage Tenants", "1.0", item => item.Action("List", "Admin", new { area = "Orchard.MultiTenancy" }).Permission(Permissions.ManageTenants)) + ); + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs new file mode 100644 index 000000000..5f1d79eaa --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs @@ -0,0 +1,18 @@ +using System.Web.Mvc; +using Orchard.Localization; +using Orchard.MultiTenancy.ViewModels; + +namespace Orchard.MultiTenancy.Controllers { + [ValidateInput(false)] + public class AdminController : Controller { + public AdminController() { + T = NullLocalizer.Instance; + } + + private Localizer T { get; set; } + + public ActionResult List() { + return View(new TenantsListViewModel()); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Module.txt b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Module.txt new file mode 100644 index 000000000..d63affb83 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Module.txt @@ -0,0 +1,2 @@ +name: MultiTenancy +antiforgery: enabled \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj new file mode 100644 index 000000000..c78c56f4b --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj @@ -0,0 +1,106 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {72457126-E118-4171-A08F-9A709EE4B7FC} + {F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Orchard.MultiTenancy + Orchard.MultiTenancy + v3.5 + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + 3.5 + + + 3.5 + + + False + ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + + + + + + + + + + + False + True + 3803 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Permissions.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Permissions.cs new file mode 100644 index 000000000..50bd38850 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Permissions.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using Orchard.Security.Permissions; + +namespace Orchard.MultiTenancy { + public class Permissions : IPermissionProvider { + public static readonly Permission ManageTenants = new Permission { Description = "Modifying Tenants of a Site", Name = "ManageTenants" }; + + public string ModuleName { + get { + return "MultiTenancy"; + } + } + + public IEnumerable GetPermissions() { + return new[] { + ManageTenants + }; + } + + public IEnumerable GetDefaultStereotypes() { + return new[] { + new PermissionStereotype { + Name = "Administrator", + Permissions = new[] {ManageTenants} + }, + }; + } + + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..3e92821c9 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.MultiTenancy")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("MSIT")] +[assembly: AssemblyProduct("Orchard.MultiTenancy")] +[assembly: AssemblyCopyright("Copyright © MSIT 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f1ee1b86-72bb-45da-b8ee-b5465d4968ba")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs new file mode 100644 index 000000000..cfe4ccff6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs @@ -0,0 +1,6 @@ +using Orchard.Mvc.ViewModels; + +namespace Orchard.MultiTenancy.ViewModels { + public class TenantsListViewModel : BaseViewModel { + } +} diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx new file mode 100644 index 000000000..7916b88cf --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx @@ -0,0 +1,15 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Import Namespace="Orchard.MultiTenancy.ViewModels"%> + + + + + + List + + +
+ Tenants +
+ + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config new file mode 100644 index 000000000..7022197d4 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config new file mode 100644 index 000000000..bca9d269d --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config @@ -0,0 +1,153 @@ + + + + + + + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index fd4eab673..9cc552f68 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -81,6 +81,7 @@ namespace Orchard.Setup.Controllers { DataConnectionString = model.DatabaseConnectionString }; + // The vanilla Orchard distibution has the following modules enabled. const string hardcoded = @"Orchard.Framework, Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,Themes,XmlRpc, Orchard.Users,Orchard.Roles,TinyMce, diff --git a/src/Orchard.sln b/src/Orchard.sln index bf1117ac7..c1102dab2 100644 --- a/src/Orchard.sln +++ b/src/Orchard.sln @@ -55,6 +55,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Specs", "Orchard.Sp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard", "Tools\Orchard\Orchard.csproj", "{33B1BC8D-E292-4972-A363-22056B207156}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MultiTenancy", "Orchard.Web\Modules\Orchard.MultiTenancy\Orchard.MultiTenancy.csproj", "{72457126-E118-4171-A08F-9A709EE4B7FC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -153,6 +155,10 @@ Global {33B1BC8D-E292-4972-A363-22056B207156}.Debug|Any CPU.Build.0 = Debug|Any CPU {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.ActiveCfg = Release|Any CPU {33B1BC8D-E292-4972-A363-22056B207156}.Release|Any CPU.Build.0 = Release|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72457126-E118-4171-A08F-9A709EE4B7FC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -174,6 +180,7 @@ Global {5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {4A9C04A6-0986-4A92-A610-5F59FF273FB9} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {8C7FCBC2-E6E1-405E-BFB5-D8D9E67A09C4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} + {72457126-E118-4171-A08F-9A709EE4B7FC} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {5E5E7A21-C7B2-44D8-8593-2F9541AE041D} = {383DBA32-4A3E-48D1-AAC3-75377A694452} {4AB4B5B6-277E-4FF6-B69B-7AE9E16D2A56} = {383DBA32-4A3E-48D1-AAC3-75377A694452} {33B1BC8D-E292-4972-A363-22056B207156} = {383DBA32-4A3E-48D1-AAC3-75377A694452} From 8434039294e1554f57010304827a14d093084d3f Mon Sep 17 00:00:00 2001 From: Suha Can Date: Wed, 21 Apr 2010 12:32:01 -0700 Subject: [PATCH 2/3] - Adding new module ref to the web app. --HG-- branch : dev --- src/Orchard.Web/Orchard.Web.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 5128a4a58..200551b08 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -126,6 +126,10 @@ {D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} Orchard.Media + + {72457126-E118-4171-A08F-9A709EE4B7FC} + Orchard.MultiTenancy + {4A9C04A6-0986-4A92-A610-5F59FF273FB9} Orchard.Pages From 410c304bbc16bfd80a82e5f3d7a488b64d82e8d3 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Wed, 21 Apr 2010 13:53:03 -0700 Subject: [PATCH 3/3] - MultiTenancy module lists current tenants of the site. - TenantService abstraction to list/add tenants. - TenantCommand and multitenancy admin controllers on top of the tenantservice. - Simple Tenant list UI for the backend. --HG-- branch : dev --- .../Commands/TenantCommand.cs | 29 +++++++++++++++++ .../Controllers/AdminController.cs | 12 +++++-- .../Orchard.MultiTenancy.csproj | 7 ++++- .../Services/ITenantService.cs | 8 +++++ .../Services/TenantService.cs | 20 ++++++++++++ .../ViewModels/TenantsAddViewModel.cs | 6 ++++ .../ViewModels/TenantsListViewModel.cs | 5 ++- .../Views/Admin/{List.aspx => Add.aspx} | 8 ++--- .../Views/Admin/List.ascx | 31 +++++++++++++++++++ .../Commands/DefaultOrchardCommandHandler.cs | 1 - 10 files changed, 118 insertions(+), 9 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Commands/TenantCommand.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/ITenantService.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/TenantService.cs create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsAddViewModel.cs rename src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/{List.aspx => Add.aspx} (73%) create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.ascx diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Commands/TenantCommand.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Commands/TenantCommand.cs new file mode 100644 index 000000000..1a4372250 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Commands/TenantCommand.cs @@ -0,0 +1,29 @@ +using Orchard.Commands; +using Orchard.MultiTenancy.Services; + +namespace Orchard.MultiTenancy.Commands { + public class TenantCommand : DefaultOrchardCommandHandler { + private readonly ITenantService _tenantService; + + public TenantCommand(ITenantService tenantService) { + _tenantService = tenantService; + } + + [CommandHelp("tenant list: Display current tenants of a site")] + [CommandName("tenant list")] + public void List() { + Context.Output.WriteLine(T("List of tenants")); + Context.Output.WriteLine(T("---------------------------")); + + var tenants = _tenantService.GetTenants(); + foreach (var tenant in tenants) { + Context.Output.WriteLine(T("---------------------------")); + Context.Output.WriteLine(T("Name: ") + tenant.Name); + Context.Output.WriteLine(T("Provider: ") + tenant.DataProvider); + Context.Output.WriteLine(T("ConnectionString: ") + tenant.DataConnectionString); + Context.Output.WriteLine(T("Prefix: ") + tenant.DataPrefix); + Context.Output.WriteLine(T("---------------------------")); + } + } + } +} diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs index 5f1d79eaa..f5089fa0c 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Controllers/AdminController.cs @@ -1,18 +1,26 @@ using System.Web.Mvc; using Orchard.Localization; +using Orchard.MultiTenancy.Services; using Orchard.MultiTenancy.ViewModels; namespace Orchard.MultiTenancy.Controllers { [ValidateInput(false)] public class AdminController : Controller { - public AdminController() { + private readonly ITenantService _tenantService; + + public AdminController(ITenantService tenantService) { + _tenantService = tenantService; T = NullLocalizer.Instance; } private Localizer T { get; set; } public ActionResult List() { - return View(new TenantsListViewModel()); + return View(new TenantsListViewModel { TenantSettings = _tenantService.GetTenants() }); + } + + public ActionResult Add() { + return View(new TenantsAddViewModel()); } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj index c78c56f4b..93014230a 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj @@ -58,14 +58,19 @@ + + + + - + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/ITenantService.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/ITenantService.cs new file mode 100644 index 000000000..799a22816 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/ITenantService.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic; +using Orchard.Environment.Configuration; + +namespace Orchard.MultiTenancy.Services { + public interface ITenantService : IDependency { + IEnumerable GetTenants(); + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/TenantService.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/TenantService.cs new file mode 100644 index 000000000..5a087d4dc --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Services/TenantService.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; +using Orchard.Environment.Configuration; + +namespace Orchard.MultiTenancy.Services { + public class TenantService : ITenantService { + private readonly IShellSettingsManager _shellSettingsManager; + + public TenantService(IShellSettingsManager shellSettingsManager) { + _shellSettingsManager = shellSettingsManager; + } + + #region Implementation of ITenantService + + public IEnumerable GetTenants() { + return _shellSettingsManager.LoadSettings(); + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsAddViewModel.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsAddViewModel.cs new file mode 100644 index 000000000..1af812b54 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsAddViewModel.cs @@ -0,0 +1,6 @@ +using Orchard.Mvc.ViewModels; + +namespace Orchard.MultiTenancy.ViewModels { + public class TenantsAddViewModel : BaseViewModel { + } +} diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs index cfe4ccff6..1ec6f5bfb 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/ViewModels/TenantsListViewModel.cs @@ -1,6 +1,9 @@ -using Orchard.Mvc.ViewModels; +using System.Collections.Generic; +using Orchard.Environment.Configuration; +using Orchard.Mvc.ViewModels; namespace Orchard.MultiTenancy.ViewModels { public class TenantsListViewModel : BaseViewModel { + public IEnumerable TenantSettings { get; set; } } } diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Add.aspx similarity index 73% rename from src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx rename to src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Add.aspx index 7916b88cf..5c87a7e7e 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.aspx +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Add.aspx @@ -1,15 +1,15 @@ -<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> <%@ Import Namespace="Orchard.MultiTenancy.ViewModels"%> - - List + + Add a new Tenant
- Tenants + Add tenant...
diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.ascx b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.ascx new file mode 100644 index 000000000..e6533c341 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/List.ascx @@ -0,0 +1,31 @@ +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Import Namespace="Orchard.Mvc.Html"%> +<%@ Import Namespace="Orchard.MultiTenancy.ViewModels"%> +<%@ Import Namespace="Orchard.ContentManagement"%> +

<%=Html.TitleForPage(T("List of Site's Tenants").ToString())%>

+ + + + + + + + + + + + + + + + <% + foreach (var tenant in Model.TenantSettings) { %> + + + + + + <% + } %> + +
<%=_Encoded("Name") %><%=_Encoded("Provider") %><%=_Encoded("ConnectionString") %><%=_Encoded("Prefix") %>
<%= tenant.Name %><%= tenant.DataProvider %><%= tenant.DataConnectionString %><%= tenant.DataPrefix %>
\ No newline at end of file diff --git a/src/Orchard/Commands/DefaultOrchardCommandHandler.cs b/src/Orchard/Commands/DefaultOrchardCommandHandler.cs index f593fd6b8..a14cd6c47 100644 --- a/src/Orchard/Commands/DefaultOrchardCommandHandler.cs +++ b/src/Orchard/Commands/DefaultOrchardCommandHandler.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.Linq; using System.Reflection; using Orchard.Localization;