1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.utils.isPOST
4 import net.pterodactylus.sone.web.WebInterface
5 import net.pterodactylus.sone.web.page.FreenetRequest
6 import net.pterodactylus.util.template.Template
7 import net.pterodactylus.util.template.TemplateContext
10 * Page that lets the user distrust another Sone. This will assign a
11 * configurable (negative) amount of trust to an identity.
13 * @see net.pterodactylus.sone.core.Core#distrustSone(Sone, Sone)
15 class DistrustPage(template: Template, webInterface: WebInterface):
16 SoneTemplatePage("distrust.html", template, "Page.Distrust.Title", webInterface, true) {
18 override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) {
20 val sone = webInterface.core.getSone(request.httpRequest.getPartAsStringFailsafe("sone", 44)).orNull()
21 sone?.run { webInterface.core.distrustSone(getCurrentSone(request.toadletContext), this) }
22 throw RedirectException(request.httpRequest.getPartAsStringFailsafe("returnPage", 256))