]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_oper.cpp
Fixed bug #418 (incorrect numerics for part of /ADMIN and /USERS) - patch by Zaba
[user/henk/code/inspircd.git] / src / cmd_oper.cpp
index 63c7dc3e3bdc1502bf262e33f7451d9debe40ed1..8d1c753a60d4231d694acf8d100d4c3358fb48af 100644 (file)
  */
 
 #include "inspircd.h"
-#include "configreader.h"
-#include "typedefs.h"
-#include "users.h"
-#include "modules.h"
 #include "wildcard.h"
 #include "commands/cmd_oper.h"
 #include "hashcomp.h"
@@ -122,10 +118,13 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user)
                        std::string fields;
                        if (!match_login)
                                fields.append("login ");
-                       if (!match_pass)
-                               fields.append("password ");
-                       if (!match_hosts)
-                               fields.append("hosts");
+                       else
+                       {
+                               if (!match_pass)
+                                       fields.append("password ");
+                               if (!match_hosts)
+                                       fields.append("hosts");
+                       }
                        user->WriteServ("491 %s :Invalid oper credentials",user->nick);
                        
                        snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick,user->ident,user->host, parameters[0], fields.c_str());