From 457c4f211f055b54031d8c8822bddc4d78af91c3 Mon Sep 17 00:00:00 2001 From: Daniel Vassdal Date: Tue, 12 Nov 2013 08:28:40 -0800 Subject: Fix remote /MODULES bug --- src/commands/cmd_modules.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/commands/cmd_modules.cpp') diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index b8a1805b0..e21df9b08 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -49,8 +49,11 @@ class CommandModules : public Command /** Handle /MODULES */ -CmdResult CommandModules::Handle (const std::vector&, User *user) +CmdResult CommandModules::Handle (const std::vector& parameters, User *user) { + if (parameters.size() >= 1 && parameters[0] != ServerInstance->Config->ServerName) + return CMD_SUCCESS; + std::vector module_names = ServerInstance->Modules->GetAllModuleNames(0); for (unsigned int i = 0; i < module_names.size(); i++) @@ -58,7 +61,7 @@ CmdResult CommandModules::Handle (const std::vector&, User *user) Module* m = ServerInstance->Modules->Find(module_names[i]); Version V = m->GetVersion(); - if (user->HasPrivPermission("servers/auspex")) + if (IS_LOCAL(user) && user->HasPrivPermission("servers/auspex")) { std::string flags("SvcC"); int pos = 0; -- cgit v1.2.3 From ed57ffc4febceeb30da35a37ac0b0c386234dd3b Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 21 Jan 2014 14:04:45 +0100 Subject: Increase the penalty for a few core commands --- src/commands/cmd_admin.cpp | 7 ++++++- src/commands/cmd_commands.cpp | 6 +++++- src/commands/cmd_info.cpp | 7 ++++++- src/commands/cmd_modules.cpp | 7 ++++++- 4 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src/commands/cmd_modules.cpp') diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp index 3a3eed346..0d6c235f0 100644 --- a/src/commands/cmd_admin.cpp +++ b/src/commands/cmd_admin.cpp @@ -30,7 +30,12 @@ class CommandAdmin : public Command public: /** Constructor for admin. */ - CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0) { syntax = "[]"; } + CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0) + { + Penalty = 2; + syntax = "[]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_commands.cpp b/src/commands/cmd_commands.cpp index 36408b363..1555b4d04 100644 --- a/src/commands/cmd_commands.cpp +++ b/src/commands/cmd_commands.cpp @@ -30,7 +30,11 @@ class CommandCommands : public Command public: /** Constructor for commands. */ - CommandCommands ( Module* parent) : Command(parent,"COMMANDS",0,0) { } + CommandCommands(Module* parent) : Command(parent,"COMMANDS",0,0) + { + Penalty = 3; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_info.cpp b/src/commands/cmd_info.cpp index 6e5f2a909..76e414b19 100644 --- a/src/commands/cmd_info.cpp +++ b/src/commands/cmd_info.cpp @@ -32,7 +32,12 @@ class CommandInfo : public Command public: /** Constructor for info. */ - CommandInfo ( Module* parent) : Command(parent,"INFO") { syntax = "[]"; } + CommandInfo(Module* parent) : Command(parent,"INFO") + { + Penalty = 4; + syntax = "[]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index e21df9b08..2a15b43ed 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -31,7 +31,12 @@ class CommandModules : public Command public: /** Constructor for modules. */ - CommandModules ( Module* parent) : Command(parent,"MODULES",0,0) { syntax = "[server]"; } + CommandModules(Module* parent) : Command(parent,"MODULES",0,0) + { + Penalty = 4; + syntax = "[]"; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command -- cgit v1.2.3