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
948 B
39 lines
948 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using FLocal.Core;
|
|
|
|
namespace FLocal.IISHandler.handlers.request {
|
|
abstract class AbstractNewMessageHandler : AbstractPostHandler {
|
|
|
|
protected override string templateName {
|
|
get {
|
|
return "result/MessageCreated.xslt";
|
|
}
|
|
}
|
|
|
|
protected string getTitle(WebContext context) {
|
|
string title = context.httprequest.Form["title"].Trim();
|
|
if(title == "") {
|
|
throw new FLocalException("Title is empty");
|
|
}
|
|
if(title.Length > 100) {
|
|
throw new FLocalException("Title is too long");
|
|
}
|
|
return title;
|
|
}
|
|
|
|
protected string getBody(WebContext context) {
|
|
string body = context.httprequest.Form["Body"].Trim();
|
|
if(body == "") {
|
|
throw new FLocalException("Body is empty");
|
|
}
|
|
if(body.Length > 30000) {
|
|
throw new FLocalException("Body is too long");
|
|
}
|
|
return body;
|
|
}
|
|
|
|
}
|
|
}
|
|
|