1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 02:03:13 +02:00

Include ip for web clients in command log messages for source

This commit is contained in:
Adam
2017-03-16 20:22:59 -04:00
parent 516ab164f6
commit b831cd8a36
14 changed files with 36 additions and 24 deletions
+6 -2
View File
@@ -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<Anope::string> &params, 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<Anope::string> &params, TemplateFileServer::Replacements &r, const Anope::string &key)
{
ServiceReference<Command> 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<Anope::string> &params, 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<Anope::string> &params, TemplateFileServer::Replacements &r, const Anope::string &key)
{
ServiceReference<Command> 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);
}