From ce1d3b31c4cb635744d80a604e9fa0a9c2eaa98b Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Mon, 31 Jan 2011 17:54:12 -0800 Subject: [PATCH] #17191 Return the Register page as a ShapeResult --HG-- branch : dev --- .../Modules/Orchard.Users/Controllers/AccountController.cs | 6 ++++-- src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj | 2 +- .../Orchard.Users/Views/Account/ChangePassword.cshtml | 2 +- .../Modules/Orchard.Users/Views/Account/LostPassword.cshtml | 2 +- .../Orchard.Users/Views/{Account => }/Register.cshtml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) rename src/Orchard.Web/Modules/Orchard.Users/Views/{Account => }/Register.cshtml (93%) diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs index b135cc68d..c24a6046d 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs @@ -99,7 +99,8 @@ namespace Orchard.Users.Controllers { ViewData["PasswordLength"] = MinPasswordLength; - return View(); + var shape = _orchardServices.New.Register(); + return new ShapeResult(this, shape); } [HttpPost] @@ -135,7 +136,8 @@ namespace Orchard.Users.Controllers { } // If we got this far, something failed, redisplay form - return Register(); + var shape = _orchardServices.New.Register(); + return new ShapeResult(this, shape); } public ActionResult RequestLostPassword() { diff --git a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj index 7d57aaec9..9703a4744 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj +++ b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj @@ -89,7 +89,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChangePassword.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChangePassword.cshtml index 592bbaf25..070784f99 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChangePassword.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/ChangePassword.cshtml @@ -1,7 +1,7 @@ @model dynamic

@Html.TitleForPage(T("Change Password").ToString())

@T("Use the form below to change your password.")

-

@T("New passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"] as string)

+

@T("New passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"])

@Html.ValidationSummary(T("Password change was unsuccessful. Please correct the errors and try again.").ToString()) @using (Html.BeginFormAntiForgeryPost()) {
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LostPassword.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LostPassword.cshtml index 3a3b59413..434952452 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LostPassword.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LostPassword.cshtml @@ -1,7 +1,7 @@ @model dynamic

@Html.TitleForPage(T("Change Password").ToString())

@T("Use the form below to change your password.")

-

@T("New passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"] as string)

+

@T("New passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"])

@Html.ValidationSummary(T("Password change was unsuccessful. Please correct the errors and try again.").ToString()) @using (Html.BeginFormAntiForgeryPost()) {
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/Register.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Register.cshtml similarity index 93% rename from src/Orchard.Web/Modules/Orchard.Users/Views/Account/Register.cshtml rename to src/Orchard.Web/Modules/Orchard.Users/Views/Register.cshtml index 8529f5897..a349f1a0f 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/Register.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Register.cshtml @@ -1,6 +1,6 @@ 

@Html.TitleForPage(T("Create a New Account").ToString())

@T("Use the form below to create a new account.")

-

@T("Passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"] as string)

+

@T("Passwords are required to be a minimum of {0} characters in length.", ViewData["PasswordLength"])

@Html.ValidationSummary(T("Account creation was unsuccessful. Please correct the errors and try again.").ToString()) @using (Html.BeginFormAntiForgeryPost()) {