X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDistrustPage.kt;h=f2115e52bb14b8393a99e50e9fb662a9454465cb;hb=HEAD;hp=70755f5eb50fcfaa8e81bbb8f4cd7490397abbe8;hpb=6f1f26e3998cfef155b0cf59152827accea70d30;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt deleted file mode 100644 index 70755f5..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt +++ /dev/null @@ -1,27 +0,0 @@ -package net.pterodactylus.sone.web.pages - -import net.pterodactylus.sone.data.Sone -import net.pterodactylus.sone.utils.isPOST -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 - -/** - * Page that lets the user distrust another Sone. This will assign a - * configurable (negative) amount of trust to an identity. - * - * @see net.pterodactylus.sone.core.Core#distrustSone(Sone, Sone) - */ -class DistrustPage(template: Template, webInterface: WebInterface): - LoggedInPage("distrust.html", template, "Page.Distrust.Title", webInterface) { - - override fun handleRequest(freenetRequest: FreenetRequest, currentSone: Sone, templateContext: TemplateContext) { - if (freenetRequest.isPOST) { - webInterface.core.getSone(freenetRequest.httpRequest.getPartAsStringFailsafe("sone", 44)) - ?.run { webInterface.core.distrustSone(currentSone, this) } - throw RedirectException(freenetRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) - } - } - -}