]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_oper.cpp
Merge pull request #523 from SaberUK/master+server-notice
[user/henk/code/inspircd.git] / src / commands / cmd_oper.cpp
index e3f79d3474db3524f55056710bc769d4d1e83356..1178137197e1e442cc4083e6dd117ef6930ef5f1 100644 (file)
@@ -66,7 +66,7 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
        bool match_hosts = false;
 
        snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host.c_str());
-       snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString());
+       snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString().c_str());
 
        OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
        if (i != ServerInstance->Config->oper_blocks.end())
@@ -84,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)
@@ -98,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",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;
 }