#include "inspircd.h"
+#include "modules/account.h"
class ModulePassForward : public Module
{
ConfigTag* tag = ServerInstance->Config->ConfValue("passforward");
nickrequired = tag->getString("nick", "NickServ");
forwardmsg = tag->getString("forwardmsg", "NOTICE $nick :*** Forwarding PASS to $nickrequired");
- forwardcmd = tag->getString("cmd", "PRIVMSG $nickrequired :IDENTIFY $pass");
+ forwardcmd = tag->getString("cmd", "SQUERY $nickrequired :IDENTIFY $pass");
}
void FormatStr(std::string& result, const std::string& format, const LocalUser* user)
if (!user->MyClass->config->getString("password").empty())
return;
+ AccountExtItem* actext = GetAccountExtItem();
+ if (actext && actext->get(user))
+ {
+ // User is logged in already (probably via SASL) don't forward the password
+ return;
+ }
+
if (!nickrequired.empty())
{
/* Check if nick exists and its server is ulined */
}
std::string tmp;
- FormatStr(tmp,forwardmsg, user);
- user->WriteServ(tmp);
+ FormatStr(tmp, forwardmsg, user);
+ ServerInstance->Parser.ProcessBuffer(user, tmp);
tmp.clear();
FormatStr(tmp,forwardcmd, user);