X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FRescuePage.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FRescuePage.kt;h=c3fabdbf3ba737b8185a2a3f41cba47d75b96257;hp=dbcf59f9632d748da8338b7af65da4d07afe100a;hb=74cbe983cd38da24847e6247ac595cb70d8e115b;hpb=88ed72c4e8971a1d6e93a889f6774338d53682c6 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt index dbcf59f..c3fabdb 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt @@ -1,5 +1,6 @@ package net.pterodactylus.sone.web.pages +import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.utils.isPOST import net.pterodactylus.sone.utils.parameters import net.pterodactylus.sone.web.WebInterface @@ -11,10 +12,10 @@ import net.pterodactylus.util.template.TemplateContext * Page that lets the user control the rescue mode for a Sone. */ class RescuePage(template: Template, webInterface: WebInterface): - SoneTemplatePage("rescue.html", template, "Page.Rescue.Title", webInterface, true) { + LoggedInPage("rescue.html", template, "Page.Rescue.Title", webInterface) { - override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { - val soneRescuer = webInterface.core.getSoneRescuer(getCurrentSone(freenetRequest.toadletContext)!!) + override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) { + val soneRescuer = webInterface.core.getSoneRescuer(currentSone) templateContext["soneRescuer"] = soneRescuer if (freenetRequest.isPOST) { freenetRequest.parameters["edition", 9]?.toIntOrNull()?.also {