Applying security fix

http://docs.orchardproject.net/Documentation/Patch-20150519
This commit is contained in:
Sebastien Ros 2015-06-30 11:24:58 -07:00
parent d6748006a6
commit faa551cd0b
2 changed files with 10 additions and 5 deletions

View File

@ -287,6 +287,7 @@ namespace Orchard.Users.Controllers {
return RedirectToAction("Index");
}
[HttpPost]
public ActionResult SendChallengeEmail(int id) {
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();
@ -302,7 +303,9 @@ namespace Orchard.Users.Controllers {
return RedirectToAction("Index");
}
public ActionResult Approve(int id) {
[HttpPost]
public ActionResult Approve(int id)
{
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();
@ -316,7 +319,9 @@ namespace Orchard.Users.Controllers {
return RedirectToAction("Index");
}
public ActionResult Moderate(int id) {
[HttpPost]
public ActionResult Moderate(int id)
{
if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not authorized to manage users")))
return new HttpUnauthorizedResult();

View File

@ -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) { <text>|</text>
@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" })
}
</td>
</tr>