]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_oper/cmd_oper.cpp
Merge pull request #1103 from rburchell/master-fix-info
[user/henk/code/inspircd.git] / src / coremods / core_oper / cmd_oper.cpp
index bd7a35060e8e82a7c10543c322d08cc9bc825ef2..e4ba69549e6f7a6ffb6adce0da1a754c8c15bd3d 100644 (file)
 
 
 #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 = "<username> <password>"; }
-       /** 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<std::string>& parameters, LocalUser *user);
-};
+       syntax = "<username> <password>";
+}
 
 CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, LocalUser *user)
 {
@@ -46,7 +37,7 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& 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<std::string>& 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)