diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-10 14:23:16 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-10 14:23:16 +0000 |
commit | 1f2b4e2541df088f879a8d5cfcc65687dc6b78f1 (patch) | |
tree | 3b04e478837be247dce7061f2ed7bda537926deb /src | |
parent | c64fa61312c12ff5823f759e44e25b814a9e60f8 (diff) |
Fix for bug #281, oper fail notices should be global
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6955 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_oper.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp index 7c7ab391e..59b35deba 100644 --- a/src/cmd_oper.cpp +++ b/src/cmd_oper.cpp @@ -108,6 +108,10 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) } else { + std::deque<std::string> n; + n.push_back("o"); + char broadcast[MAXBUF]; + if (!type_invalid) { std::string fields = ""; @@ -118,14 +122,27 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) if (!match_hosts) fields.append("hosts"); user->WriteServ("491 %s :Invalid oper credentials",user->nick); - ServerInstance->SNO->WriteToSnoMask('o',"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()); + + 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()); + ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); + n.push_back(broadcast); + Event rmode2((char *)&n, NULL, "send_snoset"); + rmode2.Send(ServerInstance); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick,user->ident,user->host,parameters[0],fields.c_str()); return CMD_FAILURE; } else { user->WriteServ("491 %s :Your oper block does not have a valid opertype associated with it",user->nick); - ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0],OperType); + + snprintf(broadcast, MAXBUF, "CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0],OperType); + + ServerInstance->SNO->WriteToSnoMask('o', std::string(broadcast)); + n.push_back(broadcast); + Event rmode2((char *)&n, NULL, "send_snoset"); + rmode2.Send(ServerInstance); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick,user->ident,user->host,parameters[0]); return CMD_FAILURE; } |