1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.data.Sone
4 import net.pterodactylus.sone.utils.isPOST
5 import net.pterodactylus.sone.web.WebInterface
6 import net.pterodactylus.sone.web.page.FreenetRequest
7 import net.pterodactylus.util.template.Template
8 import net.pterodactylus.util.template.TemplateContext
11 * Lets the user delete a Sone. Of course the Sone is not really deleted from
12 * Freenet; merely all references to it are removed from the local plugin
15 class DeleteSonePage(template: Template, webInterface: WebInterface):
16 LoggedInPage("deleteSone.html", template, "Page.DeleteSone.Title", webInterface) {
18 override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) {
19 if (freenetRequest.isPOST) {
20 if (freenetRequest.httpRequest.isPartSet("deleteSone")) {
21 webInterface.core.deleteSone(currentSone)
23 throw RedirectException("index.html")