X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_oper%2Fcmd_oper.cpp;h=e4ba69549e6f7a6ffb6adce0da1a754c8c15bd3d;hb=3e0ac4917242a6d62452e7c70aea25dc7bc1e39d;hp=bd7a35060e8e82a7c10543c322d08cc9bc825ef2;hpb=c67d3103e9f7397f0ab9631bf07a5e5547deb2c3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_oper/cmd_oper.cpp b/src/coremods/core_oper/cmd_oper.cpp index bd7a35060..e4ba69549 100644 --- a/src/coremods/core_oper/cmd_oper.cpp +++ b/src/coremods/core_oper/cmd_oper.cpp @@ -20,22 +20,13 @@ #include "inspircd.h" +#include "core_oper.h" -/** Handle /OPER. - */ -class CommandOper : public SplitCommand +CommandOper::CommandOper(Module* parent) + : SplitCommand(parent, "OPER", 2, 2) { - public: - /** Constructor for oper. - */ - CommandOper ( Module* parent) : SplitCommand(parent,"OPER",2,2) { syntax = " "; } - /** Handle command. - * @param parameters The parameters to the command - * @param user The user issuing the command - * @return A value from CmdResult to indicate command success or failure. - */ - CmdResult HandleLocal(const std::vector& parameters, LocalUser *user); -}; + syntax = " "; +} CmdResult CommandOper::HandleLocal(const std::vector& parameters, LocalUser *user) { @@ -46,7 +37,7 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L const std::string userHost = user->ident + "@" + user->host; const std::string userIP = user->ident + "@" + user->GetIPString(); - OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); + ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]); if (i != ServerInstance->Config->oper_blocks.end()) { OperInfo* ifo = i->second; @@ -79,5 +70,3 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L ServerInstance->Logs->Log("OPER", LOG_DEFAULT, "OPER: Failed oper attempt by %s using login '%s': The following fields did not match: %s", user->GetFullRealHost().c_str(), parameters[0].c_str(), fields.c_str()); return CMD_FAILURE; } - -COMMAND_INIT(CommandOper)