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

@@ -7,6 +7,7 @@ using umbraco.cms.businesslogic.member;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using Umbraco.Core.Security;
using Umbraco.Core;
namespace Umbraco.Web.Controllers
{
@@ -32,11 +33,15 @@ namespace Umbraco.Web.Controllers
return CurrentUmbracoPage();
}
//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("ProfileUpdateSuccess", true);
//TODO: Why are we redirecting to home again here??
return Redirect("/");
return RedirectToCurrentUmbracoPage();
}
}
}