import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.template.Template;
import net.pterodactylus.util.template.TemplateContext;
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class EditAlbumPage extends SoneTemplatePage {
/**
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
public class EditAlbumPage extends SoneTemplatePage {
/**
*/
public EditAlbumPage(Template template, WebInterface webInterface) {
super("editAlbum.html", template, "Page.EditAlbum.Title", webInterface, true);
*/
public EditAlbumPage(Template template, WebInterface webInterface) {
super("editAlbum.html", template, "Page.EditAlbum.Title", webInterface, true);
super.processTemplate(request, templateContext);
if (request.getMethod() == Method.POST) {
String albumId = request.getHttpRequest().getPartAsStringFailsafe("album", 36);
super.processTemplate(request, templateContext);
if (request.getMethod() == Method.POST) {
String albumId = request.getHttpRequest().getPartAsStringFailsafe("album", 36);
if (!webInterface.getCore().isLocalSone(album.getSone())) {
throw new RedirectException("noPermission.html");
}
if (!webInterface.getCore().isLocalSone(album.getSone())) {
throw new RedirectException("noPermission.html");
}
String title = request.getHttpRequest().getPartAsStringFailsafe("title", 100).trim();
if (title.length() == 0) {
templateContext.set("titleMissing", true);
return;
}
String description = request.getHttpRequest().getPartAsStringFailsafe("description", 1000).trim();
String title = request.getHttpRequest().getPartAsStringFailsafe("title", 100).trim();
if (title.length() == 0) {
templateContext.set("titleMissing", true);
return;
}
String description = request.getHttpRequest().getPartAsStringFailsafe("description", 1000).trim();
- album.setTitle(title).setDescription(description);
- webInterface.getCore().saveSone(album.getSone());
+ album.setTitle(title).setDescription(TextFilter.filter(request.getHttpRequest().getHeader("host"), description));
+ webInterface.getCore().touchConfiguration();