1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.utils.also
4 import net.pterodactylus.sone.utils.isPOST
5 import net.pterodactylus.sone.utils.parameters
6 import net.pterodactylus.sone.web.WebInterface
7 import net.pterodactylus.sone.web.page.FreenetRequest
8 import net.pterodactylus.util.template.Template
9 import net.pterodactylus.util.template.TemplateContext
12 * Page that lets the user untrust another Sone. This will remove all trust
13 * assignments for an identity.
15 class UntrustPage(template: Template, webInterface: WebInterface):
16 SoneTemplatePage("untrust.html", template, "Page.Untrust.Title", webInterface, true) {
18 override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) {
20 getCurrentSone(request.toadletContext)!!.also { currentSone ->
21 request.parameters["sone", 44]
22 .let(webInterface.core::getSone)
23 .also { webInterface.core.untrustSone(currentSone, it) }
25 throw RedirectException(request.parameters["returnPage", 256])