X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FUnlockSonePage.kt;h=0567af271adba25769dbe53c39d65ce8dc7adbfb;hp=7ed2418be45a5da8b652b03dd651e7c6a827f186;hb=d63b7445567b65ffdbd50fa8f7ffbfea1304dff9;hpb=848fabcf16150e5f650c83490be6a2e7109d3ce6 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt index 7ed2418..0567af2 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt @@ -11,14 +11,14 @@ import net.pterodactylus.util.template.TemplateContext * This page lets the user unlock a [net.pterodactylus.sone.data.Sone] to allow its insertion. */ class UnlockSonePage(template: Template, webInterface: WebInterface): - SoneTemplatePage("unlockSone.html", template, "Page.UnlockSone.Title", webInterface, false) { + SoneTemplatePage("unlockSone.html", webInterface, template, "Page.UnlockSone.Title") { - override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { - if (request.isPOST) { - request.parameters["sone", 44] + override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { + if (freenetRequest.isPOST) { + freenetRequest.parameters["sone", 44] .let(webInterface.core::getLocalSone) ?.also(webInterface.core::unlockSone) - throw RedirectException(request.parameters["returnPage", 256]) + throw RedirectException(freenetRequest.parameters["returnPage", 256]) } }