]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_oper.cpp
Update wiki links to use HTTPS and point to the correct pages.
[user/henk/code/inspircd.git] / src / commands / cmd_oper.cpp
index 2fd7744ee969f6792a3372b1ae981e11e043647c..95f6b98df3f45bc7a04a2b3073c1d7a082db4b11 100644 (file)
@@ -20,7 +20,6 @@
 
 
 #include "inspircd.h"
-#include "hashcomp.h"
 
 bool OneOfMatches(const char* host, const char* ip, const char* hostlist);
 
@@ -70,7 +69,7 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
        snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
 
        OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
-       if (i != ServerInstance->Config->oper_blocks.end())
+       if ((i != ServerInstance->Config->oper_blocks.end()) && (i->second->oper_block))
        {
                OperInfo* ifo = i->second;
                ConfigTag* tag = ifo->oper_block;
@@ -85,7 +84,6 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
                        return CMD_SUCCESS;
                }
        }
-       char broadcast[MAXBUF];
 
        std::string fields;
        if (!match_login)
@@ -99,10 +97,8 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
        user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str());
        user->CommandFloodPenalty += 10000;
 
-       snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str());
-       ServerInstance->SNO->WriteGlobalSno('o',std::string(broadcast));
-
-       ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str());
+       ServerInstance->SNO->WriteGlobalSno('o', "WARNING! Failed oper attempt by %s using login '%s': The following fields do not match: %s", user->GetFullRealHost().c_str(), parameters[0].c_str(), fields.c_str());
+       ServerInstance->Logs->Log("OPER",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;
 }