From b831cd8a36bd42fae90e1c0fd408aacf62657ea0 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 16 Mar 2017 20:22:59 -0400 Subject: Include ip for web clients in command log messages for source --- modules/webcpanel/webcpanel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/webcpanel/webcpanel.cpp') diff --git a/modules/webcpanel/webcpanel.cpp b/modules/webcpanel/webcpanel.cpp index 947248cb8..14080191e 100644 --- a/modules/webcpanel/webcpanel.cpp +++ b/modules/webcpanel/webcpanel.cpp @@ -231,7 +231,7 @@ class ModuleWebCPanel : public Module namespace WebPanel { - void RunCommand(const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key) + void RunCommand(HTTPClient *client, const Anope::string &user, NickCore *nc, const Anope::string &service, const Anope::string &c, std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key) { ServiceReference cmd("Command", c); if (!cmd) @@ -266,12 +266,15 @@ namespace WebPanel my_reply(r, key); CommandSource source(user, NULL, nc, &my_reply, bi); + source.ip = client->clientaddr.addr(); + CommandInfo info; info.name = c; + cmd->Run(source, "", info, params); } - void RunCommandWithName(NickCore *nc, const Anope::string &service, const Anope::string &c, const Anope::string &cmdname, std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key) + void RunCommandWithName(HTTPClient *client, NickCore *nc, const Anope::string &service, const Anope::string &c, const Anope::string &cmdname, std::vector ¶ms, TemplateFileServer::Replacements &r, const Anope::string &key) { ServiceReference cmd("Command", c); if (!cmd) @@ -303,6 +306,7 @@ namespace WebPanel my_reply(r, key); CommandSource source(nc->display, NULL, nc, &my_reply, bi); + source.ip = client->clientaddr.addr(); cmd->Run(source, cmdname, *info, params); } -- cgit