SoneTemplatePage("deleteImage.html", template, "Page.DeleteImage.Title", webInterface, true) {
override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) {
- val image = webInterface.core.getImage(request.httpRequest.getPartAsStringFailsafe("image", 36)) ?: throw RedirectException("invalid.html")
- if (!image.sone.isLocal) {
- throw RedirectException("noPermission.html")
- }
if (request.isPOST) {
+ val image = webInterface.core.getImage(request.httpRequest.getPartAsStringFailsafe("image", 36)) ?: throw RedirectException("invalid.html")
+ if (!image.sone.isLocal) {
+ throw RedirectException("noPermission.html")
+ }
if (request.httpRequest.isPartSet("abortDelete")) {
throw RedirectException("imageBrowser.html?image=${image.id}")
}
webInterface.core.deleteImage(image)
throw RedirectException("imageBrowser.html?album=${image.album.id}")
}
+ val image = webInterface.core.getImage(request.httpRequest.getParam("image")) ?: throw RedirectException("invalid.html")
+ if (!image.sone.isLocal) {
+ throw RedirectException("noPermission.html")
+ }
templateContext["image"] = image
}