From cdd3722009a8e2d02a8586deae1852f7af520cf6 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 28 Apr 2015 10:27:40 -0700 Subject: [PATCH] Forcing POST method on user moderation actions --- .../Modules/Orchard.Users/Controllers/AdminController.cs | 3 +++ .../Modules/Orchard.Users/Views/Admin/Index.cshtml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AdminController.cs index f842de365..28bcf0b5a 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AdminController.cs @@ -289,6 +289,7 @@ namespace Orchard.Users.Controllers { return RedirectToAction("Index"); } + [HttpPost] public ActionResult SendChallengeEmail(int id) { if (!Services.Authorizer.Authorize(Permissions.ManageUsers, T("Not authorized to manage users"))) return new HttpUnauthorizedResult(); @@ -309,6 +310,7 @@ namespace Orchard.Users.Controllers { return RedirectToAction("Index"); } + [HttpPost] public ActionResult Approve(int id) { if (!Services.Authorizer.Authorize(Permissions.ManageUsers, T("Not authorized to manage users"))) return new HttpUnauthorizedResult(); @@ -326,6 +328,7 @@ namespace Orchard.Users.Controllers { return RedirectToAction("Index"); } + [HttpPost] public ActionResult Moderate(int id) { if (!Services.Authorizer.Authorize(Permissions.ManageUsers, T("Not authorized to manage users"))) return new HttpUnauthorizedResult(); diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml index 62f393322..d5a268a3b 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml @@ -71,12 +71,12 @@ @Html.ActionLink(T("Edit").ToString(), "Edit", new { entry.User.Id }) | @Html.ActionLink(T("Delete").ToString(), "Delete", new { entry.User.Id}, new { itemprop = "RemoveUrl UnsafeUrl" }) | @if (entry.User.RegistrationStatus == UserStatus.Pending) { - @Html.ActionLink(T("Approve").ToString(), "Approve", new { entry.User.Id }) + @Html.ActionLink(T("Approve").ToString(), "Approve", new { entry.User.Id }, new { itemprop = "UnsafeUrl" }) } else { - @Html.ActionLink(T("Disable").ToString(), "Moderate", new { entry.User.Id }) + @Html.ActionLink(T("Disable").ToString(), "Moderate", new { entry.User.Id }, new { itemprop = "UnsafeUrl" }) } @if (entry.User.EmailStatus == UserStatus.Pending) { | - @Html.ActionLink(T("Send challenge E-mail").ToString(), "SendChallengeEmail", new { entry.User.Id }) + @Html.ActionLink(T("Send challenge E-mail").ToString(), "SendChallengeEmail", new { entry.User.Id }, new { itemprop = "UnsafeUrl" }) }