1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.data.*
4 import net.pterodactylus.sone.main.*
5 import net.pterodactylus.sone.web.*
6 import net.pterodactylus.sone.web.page.*
7 import net.pterodactylus.util.template.*
14 @ToadletPath("logout.html")
15 class LogoutPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
16 LoggedInPage("Page.Logout.Title", webInterface, loaders, templateRenderer) {
18 override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
19 setCurrentSone(soneRequest.toadletContext, null)
20 redirectTo("index.html")
23 override fun isEnabled(soneRequest: SoneRequest): Boolean =
24 if (soneRequest.core.preferences.requireFullAccess && !soneRequest.toadletContext.isAllowedFullAccess) {
27 getCurrentSone(soneRequest.toadletContext) != null && soneRequest.core.localSones.size != 1