diff options
Diffstat (limited to 'src/modules/m_sasl.cpp')
-rw-r--r-- | src/modules/m_sasl.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 87d87d978..91443ab4b 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -19,21 +19,30 @@ class CommandAuthenticate : public Command { + Module* Creator; public: - CommandAuthenticate (InspIRCd* Instance) : Command(Instance,"AUTHENTICATE", 0, 1) + CommandAuthenticate (InspIRCd* Instance, Module* creator) : Command(Instance,"AUTHENTICATE", 0, 1, true), Creator(creator) { this->source = "m_sasl.so"; } CmdResult Handle (const char* const* parameters, int pcnt, User *user) { + ServerInstance->Logs->Log("m_sasl", DEBUG,"AUTHENTICATE"); if (user->registered != REG_ALL) { + ServerInstance->Logs->Log("m_sasl", DEBUG,"Sending ENCAP for AUTHENTICATE"); /* Only allow AUTHENTICATE on unregistered clients */ std::deque<std::string> params; params.push_back("*"); + params.push_back("AUTHENTICATE"); + params.push_back(user->uuid); + for (int i = 0; i < pcnt; ++i) - params.push_back(parameters[0]); + params.push_back(parameters[i]); + + Event e((char*)¶ms, Creator, "send_encap"); + e.Send(ServerInstance); } return CMD_FAILURE; } @@ -52,7 +61,8 @@ class ModuleSASL : public Module Implementation eventlist[] = { I_OnEvent }; ServerInstance->Modules->Attach(eventlist, this, 1); - sasl = new CommandAuthenticate(ServerInstance); + sasl = new CommandAuthenticate(ServerInstance, this); + ServerInstance->AddCommand(sasl); } |