X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FJsonPage.kt;h=9ea1d1da2b3ad2b198a020241e8e6d96d7378a11;hp=1136616ccbee91b78181e8d9a838e4aeac1a279f;hb=4bf90851f9e7a8f31d4f58f4f74dc46d8e4ddec8;hpb=85b7420f3492af4e5591f62ad673309a76de7e04 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt index 1136616..9ea1d1d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/ajax/JsonPage.kt @@ -24,7 +24,7 @@ abstract class JsonPage(private val path: String, protected val webInterface: We override fun getPath() = path override fun isPrefixPage() = false - open fun needsFormPassword() = true + open val needsFormPassword = true open fun requiresLogin() = true protected fun createSuccessJsonObject() = JsonReturnObject(true) @@ -38,7 +38,7 @@ abstract class JsonPage(private val path: String, protected val webInterface: We if (core.preferences.isRequireFullAccess && !request.toadletContext.isAllowedFullAccess) { return response.setStatusCode(403).setStatusText("Forbidden").setContentType("application/json").write(createErrorJsonObject("auth-required").asJsonString()) } - if (needsFormPassword() && request.parameters["formPassword"] != webInterface.formPassword) { + if (needsFormPassword && request.parameters["formPassword"] != webInterface.formPassword) { return response.setStatusCode(403).setStatusText("Forbidden").setContentType("application/json").write(createErrorJsonObject("auth-required").asJsonString()) } if (requiresLogin() && (sessionProvider.getCurrentSone(request.toadletContext, false) == null)) {