fix(dsi): honour the account registration setting
Reject native registration submissions while new accounts are disabled.
This commit is contained in:
1 parent
807df47534
commit
ed8ac29cfa
1 file changed
+4
@@ -39,6 +39,10 @@ class AccountLeaf(resource.Resource):
|
|||||||
def render_POST(self, request):
|
def render_POST(self, request):
|
||||||
if self.action not in {"login.kbd", "register.kbd"}:
|
if self.action not in {"login.kbd", "register.kbd"}:
|
||||||
request.setResponseCode(405); return b""
|
request.setResponseCode(405); return b""
|
||||||
|
if self.action == "register.kbd":
|
||||||
|
from server_config import load_config
|
||||||
|
if not load_config()["registration_enabled"]:
|
||||||
|
return dialog(request, "New account registration is currently closed.")
|
||||||
value = keyboard_value(request)
|
value = keyboard_value(request)
|
||||||
if ":" not in value:
|
if ":" not in value:
|
||||||
return dialog(request, "Enter username:password")
|
return dialog(request, "Enter username:password")
|
||||||
|
|||||||
Reference in new issue
Block a user
