X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FTrustPage.kt;h=9a4c02ff362c39c0adafd70761ea56614efe91ec;hb=HEAD;hp=bdc8952c351698488625aba4cb9e21e36709cc53;hpb=ffd92ca2374c0b2218e583d02e0bdd24b8c110ae;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt deleted file mode 100644 index bdc8952..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.kt +++ /dev/null @@ -1,29 +0,0 @@ -package net.pterodactylus.sone.web.pages - -import net.pterodactylus.sone.utils.isPOST -import net.pterodactylus.sone.utils.let -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 - -/** - * Page that lets the user trust another Sone. This will assign a configurable - * amount of trust to an identity. - */ -class TrustPage(template: Template, webInterface: WebInterface): - SoneTemplatePage("trust.html", template, "Page.Trust.Title", webInterface, true) { - - override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) { - if (freenetRequest.isPOST) { - getCurrentSone(freenetRequest.toadletContext)?.also { currentSone -> - webInterface.core.getSone(freenetRequest.parameters["sone"]).let { sone -> - webInterface.core.trustSone(currentSone, sone) - } - } - throw RedirectException(freenetRequest.parameters["returnPage", 256]) - } - } - -}