summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-02-20 19:49:01 +0000
committerSadie Powell <sadie@witchery.services>2025-02-20 19:49:01 +0000
commit0c193f8149a0af210383a1798586075d132e4904 (patch)
tree7b4f2479516ed6e2e88d8f9c25228b39b4088d0c /modules
parentfa0f78b937a970049623d11361d106cf2f12cedd (diff)
Store the source address in the identify request.
Diffstat (limited to 'modules')
-rw-r--r--modules/nickserv/ns_group.cpp9
-rw-r--r--modules/nickserv/ns_identify.cpp7
-rw-r--r--modules/nickserv/ns_recover.cpp8
-rw-r--r--modules/rpc/rpc_main.cpp2
-rw-r--r--modules/sql_authentication.cpp13
-rw-r--r--modules/webcpanel/pages/index.cpp11
6 files changed, 34 insertions, 16 deletions
diff --git a/modules/nickserv/ns_group.cpp b/modules/nickserv/ns_group.cpp
index 0ccad3735..47d8066e0 100644
--- a/modules/nickserv/ns_group.cpp
+++ b/modules/nickserv/ns_group.cpp
@@ -23,7 +23,14 @@ class NSGroupRequest final
Reference<NickAlias> target;
public:
- NSGroupRequest(Module *o, CommandSource &src, Command *c, const Anope::string &n, NickAlias *targ, const Anope::string &pass) : IdentifyRequest(o, targ->nc->display, pass), source(src), cmd(c), nick(n), target(targ) { }
+ NSGroupRequest(Module *o, CommandSource &src, Command *c, const Anope::string &n, NickAlias *targ, const Anope::string &pass)
+ : IdentifyRequest(o, targ->nc->display, pass, src.ip)
+ , source(src)
+ , cmd(c)
+ , nick(n)
+ , target(targ)
+ {
+ }
void OnSuccess() override
{
diff --git a/modules/nickserv/ns_identify.cpp b/modules/nickserv/ns_identify.cpp
index a7a2b4bf7..c1f077ee5 100644
--- a/modules/nickserv/ns_identify.cpp
+++ b/modules/nickserv/ns_identify.cpp
@@ -18,7 +18,12 @@ class NSIdentifyRequest final
Command *cmd;
public:
- NSIdentifyRequest(Module *o, CommandSource &s, Command *c, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(o, acc, pass), source(s), cmd(c) { }
+ NSIdentifyRequest(Module *o, CommandSource &s, Command *c, const Anope::string &acc, const Anope::string &pass)
+ : IdentifyRequest(o, acc, pass, s.ip)
+ , source(s)
+ , cmd(c)
+ {
+ }
void OnSuccess() override
{
diff --git a/modules/nickserv/ns_recover.cpp b/modules/nickserv/ns_recover.cpp
index 4656f54e7..8de4a9e40 100644
--- a/modules/nickserv/ns_recover.cpp
+++ b/modules/nickserv/ns_recover.cpp
@@ -31,7 +31,13 @@ class NSRecoverRequest final
Anope::string user;
public:
- NSRecoverRequest(Module *o, CommandSource &src, Command *c, const Anope::string &nick, const Anope::string &pass) : IdentifyRequest(o, nick, pass), source(src), cmd(c), user(nick) { }
+ NSRecoverRequest(Module *o, CommandSource &src, Command *c, const Anope::string &nick, const Anope::string &pass)
+ : IdentifyRequest(o, nick, pass, src.ip)
+ , source(src)
+ , cmd(c)
+ , user(nick)
+ {
+ }
void OnSuccess() override
{
diff --git a/modules/rpc/rpc_main.cpp b/modules/rpc/rpc_main.cpp
index ad682817f..cee9d8837 100644
--- a/modules/rpc/rpc_main.cpp
+++ b/modules/rpc/rpc_main.cpp
@@ -22,7 +22,7 @@ class RPCIdentifyRequest final
public:
RPCIdentifyRequest(Module *m, RPC::Request &req, HTTPClient *c, RPC::ServiceInterface *iface, const Anope::string &acc, const Anope::string &pass)
- : IdentifyRequest(m, acc, pass)
+ : IdentifyRequest(m, acc, pass, c->GetIP())
, request(req)
, repl(request.reply)
, client(c)
diff --git a/modules/sql_authentication.cpp b/modules/sql_authentication.cpp
index 9a6e76d05..a7044119a 100644
--- a/modules/sql_authentication.cpp
+++ b/modules/sql_authentication.cpp
@@ -128,18 +128,9 @@ public:
SQL::Query q(this->query);
q.SetValue("a", req->GetAccount());
+ q.SetValue("i", req->GetAddress().str());
+ q.SetValue("n", u ? u->nick : "");
q.SetValue("p", req->GetPassword());
- if (u)
- {
- q.SetValue("n", u->nick);
- q.SetValue("i", u->ip.addr());
- }
- else
- {
- q.SetValue("n", "");
- q.SetValue("i", "");
- }
-
this->SQL->Run(new SQLAuthenticationResult(u, req), q);
diff --git a/modules/webcpanel/pages/index.cpp b/modules/webcpanel/pages/index.cpp
index 7b9a65c18..1cb047a98 100644
--- a/modules/webcpanel/pages/index.cpp
+++ b/modules/webcpanel/pages/index.cpp
@@ -18,7 +18,16 @@ class WebpanelRequest final
TemplateFileServer::Replacements replacements;
public:
- WebpanelRequest(Module *o, HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(o, user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { }
+ WebpanelRequest(Module *o, HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass)
+ : IdentifyRequest(o, user, pass, c->GetIP())
+ , reply(r)
+ , message(m)
+ , server(s)
+ , page_name(p_n)
+ , client(c)
+ , replacements(re)
+ {
+ }
void OnSuccess() override
{