From db92e1a80391db3a833fb596d5e8e6757c89ea25 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Mon, 26 Oct 2015 18:44:19 +0100 Subject: [PATCH] Adding a "Go back to where you were" link to post-registration pages, fixes #2295 --- .../Modules/Orchard.Users/Controllers/AccountController.cs | 4 ++-- .../Orchard.Users/Views/Account/ChallengeEmailSent.cshtml | 1 + .../Orchard.Users/Views/Account/RegistrationPending.cshtml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs index 5ba734c40..72e37cde2 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs @@ -150,11 +150,11 @@ namespace Orchard.Users.Controllers { _userService.SendChallengeEmail(user.As(), nonce => Url.MakeAbsolute(Url.Action("ChallengeEmail", "Account", new {Area = "Orchard.Users", nonce = nonce}), siteUrl)); _userEventHandler.SentChallengeEmail(user); - return RedirectToAction("ChallengeEmailSent"); + return RedirectToAction("ChallengeEmailSent", new { ReturnUrl = returnUrl }); } if (user.As().RegistrationStatus == UserStatus.Pending) { - return RedirectToAction("RegistrationPending"); + return RedirectToAction("RegistrationPending", new { ReturnUrl = returnUrl }); } _userEventHandler.LoggingIn(userName, password); diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChallengeEmailSent.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChallengeEmailSent.cshtml index 5960246f3..a60c49c39 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChallengeEmailSent.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChallengeEmailSent.cshtml @@ -1,3 +1,4 @@ @model dynamic

@Html.TitleForPage(T("Challenge Email Sent").ToString())

@T("An email has been sent to you. Please click on the link it contains in order to have access on this site.")

+

@Html.Link(T("Go back to where you were"), Url.Content(Request.QueryString["ReturnUrl"]))

diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/RegistrationPending.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/RegistrationPending.cshtml index cb4755646..b25d37c30 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/RegistrationPending.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/RegistrationPending.cshtml @@ -1,3 +1,4 @@ @model dynamic

@Html.TitleForPage(T("User Registration Pending").ToString())

@T("Your user account has been created but has to be approved before it can be used.")

+

@Html.Link(T("Go back to where you were"), Url.Content(Request.QueryString["ReturnUrl"]))