1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.data.*
4 import net.pterodactylus.sone.main.*
5 import net.pterodactylus.sone.utils.*
6 import net.pterodactylus.sone.web.*
7 import net.pterodactylus.sone.web.page.*
8 import net.pterodactylus.util.template.*
12 * Page that lets the user trust another Sone. This will assign a configurable
13 * amount of trust to an identity.
15 @ToadletPath("trust.html")
16 class TrustPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
17 LoggedInPage("Page.Trust.Title", webInterface, loaders, templateRenderer) {
19 override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
20 if (soneRequest.isPOST) {
21 soneRequest.core.getSone(soneRequest.parameters["sone"]!!)?.let { sone ->
22 soneRequest.core.trustSone(currentSone, sone)
24 redirectTo(soneRequest.parameters["returnPage", 256])