<%
- if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
- var t = tenant; %>
- <%: Html.DisplayFor(m => t, string.Format("ActionsFor{0}", tenant.State.CurrentState), "") %><%: T(" | ")%><%
- } %>
- <%: Html.ActionLink(T("Edit").ToString(), "Edit", new {name = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
- if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
- %><%--
- delete not implemented! <%: T(" | ")%>
- <%: Html.ActionLink(T("Remove").ToString(), "delete", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %>--%><%
- } %>
-
-
-
<%
- } %>
-
\ No newline at end of file
diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Index.cshtml
new file mode 100644
index 000000000..3b630d40b
--- /dev/null
+++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Admin/Index.cshtml
@@ -0,0 +1,30 @@
+@model Orchard.MultiTenancy.ViewModels.TenantsIndexViewModel
+@using Orchard.MultiTenancy.Extensions
+
+@{
+ Html.RegisterStyle("admin.css");
+}
+
+
@Html.TitleForPage(T("List of Site's Tenants").ToString())
+
@Html.ActionLink(T("Add a Tenant").ToString(), "Add", new {area = "Orchard.MultiTenancy"}, new { @class = "button primaryAction" })
+
+ @foreach (var tenant in Model.TenantSettings) {
+
+ @if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
+ var t = tenant;
+ @Html.DisplayFor(m => t, string.Format("ActionsFor{0}", tenant.State.CurrentState), "") @T(" | ")
+ }
+ @Html.ActionLink(T("Edit").ToString(), "Edit", new {name = tenant.Name, area = "Orchard.MultiTenancy"})
+
+
+
+ }
+
diff --git a/src/Orchard.sln b/src/Orchard.sln
index f8b5b53ac..04e5e6f6b 100644
--- a/src/Orchard.sln
+++ b/src/Orchard.sln
@@ -62,6 +62,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Tags", "Orchard.Web
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyMce", "Orchard.Web\Modules\TinyMce\TinyMce.csproj", "{954CA994-D204-468B-9D69-51F6AD3E1C29}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.MultiTenancy", "Orchard.Web\Modules\Orchard.MultiTenancy\Orchard.MultiTenancy.csproj", "{72457126-E118-4171-A08F-9A709EE4B7FC}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Media", "Orchard.Web\Modules\Orchard.Media\Orchard.Media.csproj", "{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Email", "Orchard.Web\Modules\Orchard.Email\Orchard.Email.csproj", "{05660F47-D649-48BD-9DED-DF4E01E7CFF9}"
@@ -315,6 +317,16 @@ Global
{954CA994-D204-468B-9D69-51F6AD3E1C29}.FxCop|Any CPU.Build.0 = Release|Any CPU
{954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{954CA994-D204-468B-9D69-51F6AD3E1C29}.Release|Any CPU.Build.0 = Release|Any CPU
+ {72457126-E118-4171-A08F-9A709EE4B7FC}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
+ {72457126-E118-4171-A08F-9A709EE4B7FC}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
+ {72457126-E118-4171-A08F-9A709EE4B7FC}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
+ {72457126-E118-4171-A08F-9A709EE4B7FC}.Coverage|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}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
+ {72457126-E118-4171-A08F-9A709EE4B7FC}.FxCop|Any CPU.Build.0 = Release|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
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
@@ -350,6 +362,7 @@ Global
{0E7646E8-FE8F-43C1-8799-D97860925EC4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{5D0F00F0-26C9-4785-AD61-B85710C60EB0} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{954CA994-D204-468B-9D69-51F6AD3E1C29} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
+ {72457126-E118-4171-A08F-9A709EE4B7FC} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{D9A7B330-CD22-4DA1-A95A-8DE1982AD8EB} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{05660F47-D649-48BD-9DED-DF4E01E7CFF9} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
diff --git a/src/Orchard/Security/Providers/FormsAuthenticationService.cs b/src/Orchard/Security/Providers/FormsAuthenticationService.cs
index 363d37e76..37f7f0107 100644
--- a/src/Orchard/Security/Providers/FormsAuthenticationService.cs
+++ b/src/Orchard/Security/Providers/FormsAuthenticationService.cs
@@ -3,18 +3,20 @@ using System.Web;
using System.Web.Security;
using Orchard.Logging;
using Orchard.ContentManagement;
+using Orchard.Mvc;
using Orchard.Services;
namespace Orchard.Security.Providers {
public class FormsAuthenticationService : IAuthenticationService {
private readonly IClock _clock;
private readonly IContentManager _contentManager;
- private readonly HttpContextBase _httpContext;
+ private readonly IHttpContextAccessor _httpContextAccessor;
- public FormsAuthenticationService(IClock clock, IContentManager contentManager, HttpContextBase httpContext) {
+ public FormsAuthenticationService(IClock clock, IContentManager contentManager, IHttpContextAccessor httpContextAccessor) {
_clock = clock;
_contentManager = contentManager;
- _httpContext = httpContext;
+ _httpContextAccessor = httpContextAccessor;
+
Logger = NullLogger.Instance;
// TEMP: who can say...
@@ -47,8 +49,9 @@ namespace Orchard.Security.Providers {
if (FormsAuthentication.CookieDomain != null) {
cookie.Domain = FormsAuthentication.CookieDomain;
}
-
- _httpContext.Response.Cookies.Add(cookie);
+
+ var httpContext = _httpContextAccessor.Current();
+ httpContext.Response.Cookies.Add(cookie);
}
public void SignOut() {
@@ -56,11 +59,12 @@ namespace Orchard.Security.Providers {
}
public IUser GetAuthenticatedUser() {
- if (!_httpContext.Request.IsAuthenticated || !(_httpContext.User.Identity is FormsIdentity)) {
+ var httpContext = _httpContextAccessor.Current();
+ if (!httpContext.Request.IsAuthenticated || !(httpContext.User.Identity is FormsIdentity)) {
return null;
}
- var formsIdentity = (FormsIdentity)_httpContext.User.Identity;
+ var formsIdentity = (FormsIdentity)httpContext.User.Identity;
var userData = formsIdentity.Ticket.UserData;
int userId;
if (!int.TryParse(userData, out userId)) {