- using (Html.BeginUmbracoForm
("HandleLogout"))
- {
-
+ You are currently logged in as @Context.User.Identity.Name
- @Html.HiddenFor(m => logoutModel.RedirectUrl)
- }
+ @using (Html.BeginUmbracoForm("HandleLogout", new { RedirectUrl = logoutModel.RedirectUrl }))
+ {
+
+ }
+
+
}
diff --git a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
index 2c860ca435..ae5703b15c 100644
--- a/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
+++ b/src/Umbraco.Web.UI.NetCore/umbraco/PartialViewMacros/Templates/RegisterMember.cshtml
@@ -1,36 +1,24 @@
-@using Umbraco.Cms.Core.Security
-@using Umbraco.Cms.Web.Website.Controllers
-@using Umbraco.Extensions
@inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage
-@inject IUmbracoWebsiteSecurityAccessor UmbracoWebsiteSecurityAccessor
+@using Microsoft.AspNetCore.Http.Extensions
+@using Umbraco.Cms.Core
+@using Umbraco.Cms.Core.Security
+@using Umbraco.Cms.Web.Website.Controllers
+@using Umbraco.Cms.Web.Website.Models
+@using Umbraco.Extensions
+@inject MemberModelBuilderFactory memberModelBuilderFactory;
@{
- @*
- You can specify a custom member type alias in the constructor, the default is 'Member'
- for example, to use 'Custom Member' you'd use this syntax:
-
- var registerModel = Members.CreateRegistrationModel("Custom Member");
- *@
-
- var websiteSecurity = UmbracoWebsiteSecurityAccessor.WebsiteSecurity;
- var registerModel = websiteSecurity.CreateRegistrationModel();
-
- @*
- Configurable here:
-
- registerModel.RedirectUrl - Optional. What path to redirect to if registration is successful.
- By default the member will be redirected to the current umbraco page
- unless this is specified.
-
- registerModel.UsernameIsEmail - the default is true
- if you want the username to be different from the email
- address, set this to true and add a new Username field in
- the form below
-
- @Html.LabelFor(m => registerModel.Username)
- @Html.TextBoxFor(m => registerModel.Username)
- @Html.ValidationMessageFor(m => registerModel.Username)
- *@
+ // Build a registration model with parameters
+ var registerModel = memberModelBuilderFactory
+ .CreateRegisterModel()
+ // Set the member type alias to use for the new member
+ .WithMemberTypeAlias(Constants.Conventions.MemberTypes.DefaultAlias)
+ // If null or not set, this will redirect to the current page
+ .WithRedirectUrl(null)
+ // Set to true if you want the member editable properties shown.
+ // It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type.
+ .LookupProperties(true)
+ .Build();
var success = TempData["FormSuccess"] != null;
}
@@ -42,58 +30,55 @@
@if (success)
{
@* This message will show if registerModel.RedirectUrl is not defined (default) *@
- Registration succeeded.
+ Registration succeeded.
}
else
{
- using (Html.BeginUmbracoForm