summaryrefslogtreecommitdiff
path: root/src/modules/m_sasl.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 19:58:49 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-21 19:58:49 +0000
commit34bb0fb31f0ab94bcd4bc72c47f591e2b27e8b10 (patch)
treea614e729494445a6319a28c4f27e5bf010d89168 /src/modules/m_sasl.cpp
parentdde67b9765bc485d807f181bba108c00f4c44dba (diff)
This seems to play nice now, but it seems we may have to redo it all AGAIN :(
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9150 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sasl.cpp')
-rw-r--r--src/modules/m_sasl.cpp16
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*)&params, 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);
}