From dc36fa1290ad7e606146ab532722ae709b979da2 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 27 Feb 2020 10:43:09 +0100 Subject: [PATCH] Fix issues in views --- .../Umbraco/PartialViewMacros/Templates/EditProfile.cshtml | 5 +++-- .../Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml | 3 ++- .../PartialViewMacros/Templates/RegisterMember.cshtml | 3 ++- src/Umbraco.Web/Composing/Current.cs | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml index 74ec033f25..5f75f8d792 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/EditProfile.cshtml @@ -1,11 +1,12 @@ @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web +@using Umbraco.Web.Composing @using Umbraco.Web.Controllers @inherits Umbraco.Web.Macros.PartialViewMacroPage @{ - var profileModel = Members.GetCurrentMemberProfileModel(); + var profileModel = Current.MembershipHelper.GetCurrentMemberProfileModel(); Html.EnableClientValidation(); Html.EnableUnobtrusiveJavaScript(); @@ -19,7 +20,7 @@ @*NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed*@ @Html.RenderJsHere() -@if (Members.IsLoggedIn() && profileModel != null) +@if (Current.MembershipHelper.IsLoggedIn() && profileModel != null) { if (success) { diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml index 8eadbb342f..78b06151af 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/LoginStatus.cshtml @@ -1,11 +1,12 @@ @using System.Web.Mvc.Html @using Umbraco.Web +@using Umbraco.Web.Composing @using Umbraco.Web.Models @using Umbraco.Web.Controllers @inherits Umbraco.Web.Macros.PartialViewMacroPage @{ - var loginStatusModel = Members.GetCurrentLoginStatus(); + var loginStatusModel = Current.MembershipHelper.GetCurrentLoginStatus(); var logoutModel = new PostRedirectModel(); @* diff --git a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml index 804e2307f0..81389f4a3d 100644 --- a/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/PartialViewMacros/Templates/RegisterMember.cshtml @@ -1,6 +1,7 @@ @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc @using Umbraco.Web +@using Umbraco.Web.Composing @using Umbraco.Web.Controllers @inherits Umbraco.Web.Macros.PartialViewMacroPage @@ -12,7 +13,7 @@ var registerModel = Members.CreateRegistrationModel("Custom Member"); *@ - var registerModel = Members.CreateRegistrationModel(); + var registerModel = Current.MembershipHelper.CreateRegistrationModel(); @* Configurable here: diff --git a/src/Umbraco.Web/Composing/Current.cs b/src/Umbraco.Web/Composing/Current.cs index 8d4af6703e..081b808cac 100644 --- a/src/Umbraco.Web/Composing/Current.cs +++ b/src/Umbraco.Web/Composing/Current.cs @@ -26,6 +26,7 @@ using Umbraco.Web.HealthCheck; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; +using Umbraco.Web.Security; using Umbraco.Web.Services; using Umbraco.Web.Trees; using Umbraco.Web.WebApi; @@ -262,6 +263,7 @@ namespace Umbraco.Web.Composing public static IUmbracoVersion UmbracoVersion => Factory.GetInstance(); public static IPublishedUrlProvider PublishedUrlProvider => Factory.GetInstance(); public static IMenuItemCollectionFactory MenuItemCollectionFactory => Factory.GetInstance(); + public static MembershipHelper MembershipHelper => Factory.GetInstance(); #endregion }