X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FUntrustPage.kt;h=7dd342e14cf79aa84cebd26480510e469bca9f65;hb=HEAD;hp=74a34b8ccef242984875e86de30713fe3aeb3219;hpb=2af59d15cd0d31c8a89509ab78d364b4efb07882;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt deleted file mode 100644 index 74a34b8..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/UntrustPage.kt +++ /dev/null @@ -1,28 +0,0 @@ -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 -import net.pterodactylus.sone.web.page.FreenetRequest -import net.pterodactylus.util.template.Template -import net.pterodactylus.util.template.TemplateContext -import javax.inject.Inject - -/** - * Page that lets the user untrust another Sone. This will remove all trust - * assignments for an identity. - */ -class UntrustPage @Inject constructor(template: Template, webInterface: WebInterface) : - LoggedInPage("untrust.html", template, "Page.Untrust.Title", webInterface) { - - override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) { - if (freenetRequest.isPOST) { - freenetRequest.parameters["sone", 44]!! - .let(webInterface.core::getSone) - ?.also { webInterface.core.untrustSone(currentSone, it) } - throw RedirectException(freenetRequest.parameters["returnPage", 256]) - } - } - -}