You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Xml.Linq;
|
|
using FLocal.Common.dataobjects;
|
|
|
|
namespace FLocal.IISHandler.handlers.request {
|
|
class PunishHandler : AbstractPostHandler {
|
|
|
|
protected override string templateName {
|
|
get {
|
|
return "result/MessagePunished.xslt";
|
|
}
|
|
}
|
|
|
|
protected override XElement[] Do(WebContext context) {
|
|
|
|
Post post = Post.LoadById(int.Parse(context.httprequest.Form["postId"]));
|
|
XElement postXml = post.exportToXml(context);
|
|
post.Punish(
|
|
context.session.account,
|
|
PunishmentType.LoadById(int.Parse(context.httprequest.Form["punishmentTypeId"])),
|
|
context.httprequest.Form["comment"].Trim(),
|
|
(context.httprequest.Form["transfer"] == "transfer")
|
|
?
|
|
(PunishmentTransfer.NewTransferInfo?)new PunishmentTransfer.NewTransferInfo(Board.LoadById(int.Parse(context.httprequest.Form["transfer_boardId"])), context.httprequest.Form["transfer_subThread"] == "transfer_subThread")
|
|
:
|
|
null
|
|
);
|
|
|
|
return new XElement[] {
|
|
post.thread.board.exportToXml(context, Board.SubboardsOptions.None),
|
|
postXml
|
|
};
|
|
}
|
|
|
|
}
|
|
}
|
|
|