mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Changed DiscardDraft actions on page/blogpost to be antiforgery checked
--HG-- branch : dev
This commit is contained in:
@@ -146,6 +146,7 @@ namespace Orchard.Blogs.Controllers {
|
||||
return Redirect(Url.BlogPostEdit(model.BlogPost.Item));
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult DiscardDraft(int id) {
|
||||
// get the current draft version
|
||||
var draft = Services.ContentManager.Get(id, VersionOptions.Draft);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<input class="button primaryAction" type="submit" name="submit.Save" value="<%=_Encoded("Save") %>"/><%
|
||||
//TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to
|
||||
if (Model.Item.HasDraft && Model.Item.HasPublished) { %>
|
||||
<%=Html.ActionLink(T("Discard Draft").ToString(), "DiscardDraft", new { Area = "Orchard.Blogs", Controller = "BlogPostAdmin", id=Model.Item.Id }, new { @class = "button" })%><%
|
||||
<%=Html.AntiForgeryTokenValueOrchardLink(T("Discard Draft").ToString(), Url.Action("DiscardDraft", new {Area = "Orchard.Blogs", Controller = "BlogPostAdmin", id = Model.Item.Id}), new {@class = "button"})%><%
|
||||
} %>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
@@ -213,6 +213,7 @@ namespace Orchard.Pages.Controllers {
|
||||
return RedirectToAction("Edit", "Admin", new {id = model.Page.Item.ContentItem.Id});
|
||||
}
|
||||
|
||||
[ValidateAntiForgeryTokenOrchard]
|
||||
public ActionResult DiscardDraft(int id) {
|
||||
// get the current draft version
|
||||
var draft = Services.ContentManager.Get(id, VersionOptions.Draft);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<input class="button primaryAction" type="submit" name="submit.Save" value="<%=_Encoded("Save") %>"/><%
|
||||
//TODO: (erikpo) In the future, remove the HasPublished check so the user can delete the content item from here if the choose to
|
||||
if (Model.Item.HasDraft && Model.Item.HasPublished) { %>
|
||||
<%=Html.ActionLink(T("Discard Draft").ToString(), "DiscardDraft", new { Area = "Orchard.Pages", Controller = "Admin", Model.Item.Id }, new { @class = "button" })%><%
|
||||
<%=Html.AntiForgeryTokenValueOrchardLink(T("Discard Draft").ToString(), Url.Action("DiscardDraft", new {Area = "Orchard.Pages", Controller = "Admin", id = Model.Item.Id}), new {@class = "button"})%><%
|
||||
} %>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user