]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_oper.cpp
Merge pull request #301 from Adam-/insp20+bindrehash
[user/henk/code/inspircd.git] / src / commands / cmd_oper.cpp
index b2db8c95cfab54dcb9574db16ef0d2aca3f07178..e3f79d3474db3524f55056710bc769d4d1e83356 100644 (file)
@@ -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 <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * 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 <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
-#include "hashcomp.h"
 
 bool OneOfMatches(const char* host, const char* ip, const char* hostlist);
 
@@ -73,15 +80,6 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& 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 +96,10 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& 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;