Obsoletes the RedirectOnSucces on the RegisterModel as it is not needed. Adds RedirectUrl to the ProfileModel and updates the controller to redirect properly (ensures it doesn't just redirect to home!)

This commit is contained in:
Shannon
2014-02-10 16:46:45 +11:00
parent 2bb58b6fca
commit 0bfd032fad
6 changed files with 57 additions and 26 deletions

View File

@@ -4,6 +4,7 @@ using System.Web.Mvc;
using System.Web.Security;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.member;
using Umbraco.Core;
using Umbraco.Core.Security;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
@@ -26,10 +27,12 @@ namespace Umbraco.Web.Controllers
switch (status)
{
case MembershipCreateStatus.Success:
if (model.RedirectOnSucces)
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
return Redirect(model.RedirectUrl);
}
//redirect to current page by default
TempData.Add("FormSuccess", true);
return RedirectToCurrentUmbracoPage();
case MembershipCreateStatus.InvalidUserName: