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=f8cedb40d609915198fc87646234899610777c4f;hp=0567af271adba25769dbe53c39d65ce8dc7adbfb;hb=c28013c8a4bcb9776a1e2d82ffd6c4c8297ffb62;hpb=d63b7445567b65ffdbd50fa8f7ffbfea1304dff9 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 0567af2..f8cedb4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePage.kt @@ -3,22 +3,23 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.utils.isPOST import net.pterodactylus.sone.utils.parameters import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.FreenetRequest +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext +import javax.inject.Inject /** * This page lets the user unlock a [net.pterodactylus.sone.data.Sone] to allow its insertion. */ -class UnlockSonePage(template: Template, webInterface: WebInterface): +class UnlockSonePage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("unlockSone.html", webInterface, template, "Page.UnlockSone.Title") { - override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { - if (freenetRequest.isPOST) { - freenetRequest.parameters["sone", 44] - .let(webInterface.core::getLocalSone) - ?.also(webInterface.core::unlockSone) - throw RedirectException(freenetRequest.parameters["returnPage", 256]) + override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) { + if (soneRequest.isPOST) { + soneRequest.parameters["sone", 44] + .let(soneRequest.core::getLocalSone) + ?.also(soneRequest.core::unlockSone) + throw RedirectException(soneRequest.parameters["returnPage", 256]) } }