]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_oper.cpp
This needs some general QA-ing. Add support to new parser (introduced in 1.1) for...
[user/henk/code/inspircd.git] / src / cmd_oper.cpp
index f7975a2e4a34feb9063a5a31012972474c0ec9d4..7c7ab391e75aa4153f1e1216b515abf3fe819b7b 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
  *
- * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
@@ -69,7 +66,7 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
                ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "host", i, HostName, MAXBUF);
 
                match_login = !strcmp(LoginName,parameters[0]);
-               match_pass = !ServerInstance->OperPassCompare(Password,parameters[1]);
+               match_pass = !ServerInstance->OperPassCompare(Password,parameters[1], i);
                match_hosts = OneOfMatches(TheHost,TheIP,HostName);
 
                if (match_login && match_pass && match_hosts)
@@ -82,9 +79,6 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
                                if (!strcmp(TypeName,OperType))
                                {
                                        /* found this oper's opertype */
-                                       ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF);
-                                       if (*HostName)
-                                               user->ChangeDisplayedHost(HostName);
                                        if (!ServerInstance->IsNick(TypeName))
                                        {
                                                user->WriteServ("491 %s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick);
@@ -92,6 +86,9 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
                                                ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host);
                                                return CMD_FAILURE;
                                        }
+                                       ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF);
+                                       if (*HostName)
+                                               user->ChangeDisplayedHost(HostName);
                                        found = true;
                                        type_invalid = false;
                                        break;