X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_oper.cpp;h=2fd7744ee969f6792a3372b1ae981e11e043647c;hb=3e365b60215447bc43683a4912896bac4a62bc31;hp=b2db8c95cfab54dcb9574db16ef0d2aca3f07178;hpb=a30abe26fc803900eaf5dc4c08a31aa1d3c9c89f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index b2db8c95c..2fd7744ee 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -1,16 +1,24 @@ -/* +------------------------------------+ - * | 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" @@ -73,15 +81,6 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L if (match_pass && match_hosts) { /* found this oper's opertype */ - std::string host = ifo->getConfig("host"); - if (!host.empty()) - user->ChangeDisplayedHost(host.c_str()); - std::string opClass = ifo->getConfig("class"); - if (!opClass.empty()) - { - user->SetClass(opClass); - user->CheckClass(); - } user->Oper(ifo); return CMD_SUCCESS; } @@ -98,11 +97,10 @@ CmdResult CommandOper::HandleLocal(const std::vector& parameters, L // tell them they suck, and lag them up to help prevent brute-force attacks user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str()); - user->Penalty += 10; + 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->WriteToSnoMask('o',std::string(broadcast)); - ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast); + 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()); return CMD_FAILURE;