X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_oper.cpp;h=1178137197e1e442cc4083e6dd117ef6930ef5f1;hb=23e8bba13c55d33ce89d505780da36c9589e300a;hp=b16a1e4247d64e558c632193b73bd4469f28c5c7;hpb=3bfd0db65ff01c026e968af4de074cc1155a4061;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index b16a1e424..117813719 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -1,18 +1,25 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2008 Thomas Stagner + * Copyright (C) 2007 Robin Burchell * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" -#include "hashcomp.h" bool OneOfMatches(const char* host, const char* ip, const char* hostlist); @@ -59,7 +66,7 @@ CmdResult CommandOper::HandleLocal(const std::vector& 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()) @@ -77,7 +84,6 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L return CMD_SUCCESS; } } - char broadcast[MAXBUF]; std::string fields; if (!match_login) @@ -91,10 +97,8 @@ CmdResult CommandOper::HandleLocal(const std::vector& 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; }