From 2abb3c67879b4d170b753554025f1c16c497ca94 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 19 Sep 2018 00:45:14 +0100 Subject: [PATCH] Only allow the register command on networks that support internal identity --- modules/permissions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/permissions.py b/modules/permissions.py index 385c6518..4d65287d 100644 --- a/modules/permissions.py +++ b/modules/permissions.py @@ -95,12 +95,19 @@ class Module(object): event["stderr"].write("You are already identified") def register(self, event): + identity_mechanism = event["server"].get_setting("identity-mechanism", + "internal") + if not identity_mechanism == "internal": + event["stderr"].write("The 'identify' command isn't available " + "on this network") + return + hash, salt = self._get_hash(event["server"], event["user"].nickname) if not hash and not salt: password = event["args_split"][0] hash, salt = self._make_hash(password) event["user"].set_setting("authentication", [hash, salt]) - self._identified(event["user"]) + self._identified(event["user"], event["user"].nickname) event["stdout"].write("Nickname registered successfully") else: event["stderr"].write("This nickname is already registered")