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=7afe79c9f66bb667c32dd3e78b630bceff74b491;hpb=cd72add62ab407336b471d4b7cda8e33dd2df5c6;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 7afe79c..0000000 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/TrustPage.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.* -import net.pterodactylus.util.template.Template -import net.pterodactylus.util.template.TemplateContext -import javax.inject.Inject - -/** - * Page that lets the user trust another Sone. This will assign a configurable - * amount of trust to an identity. - */ -class TrustPage @Inject constructor(template: Template, webInterface: WebInterface) : - LoggedInPage("trust.html", template, "Page.Trust.Title", webInterface) { - - override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { - if (soneRequest.isPOST) { - soneRequest.core.getSone(soneRequest.parameters["sone"]!!)?.let { sone -> - soneRequest.core.trustSone(currentSone, sone) - } - throw RedirectException(soneRequest.parameters["returnPage", 256]) - } - } - -}