From 4b856bda135a08e800b96c970a10b0b6a34d433a Mon Sep 17 00:00:00 2001 From: aquanight Date: Sun, 18 May 2008 23:15:53 +0000 Subject: Make User:: nick/ident/dhost/fullname and some other things std::string instead of char*/char[] (MODULES DO NOT COMPILE) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9748 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands/cmd_oper.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/commands/cmd_oper.cpp') diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 0e08c3357..8a3303093 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -54,8 +54,8 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User bool match_pass = false; bool match_hosts = false; - snprintf(TheHost,MAXBUF,"%s@%s",user->ident,user->host); - snprintf(TheIP, MAXBUF,"%s@%s",user->ident,user->GetIPString()); + snprintf(TheHost,MAXBUF,"%s@%s",user->ident.c_str(),user->host); + snprintf(TheIP, MAXBUF,"%s@%s",user->ident.c_str(),user->GetIPString()); for (int i = 0; i < ServerInstance->Config->ConfValueEnum(ServerInstance->Config->config_data, "oper"); i++) { @@ -82,9 +82,9 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User /* found this oper's opertype */ if (!ServerInstance->IsNick(TypeName)) { - user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick); + user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick.c_str()); ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",OperType); - ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick,user->ident,user->host); + ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.",user->nick.c_str(),user->ident.c_str(),user->host); return CMD_FAILURE; } ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "type","host", j, HostName, MAXBUF); @@ -107,8 +107,8 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User if (found) { /* correct oper credentials */ - ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",user->nick,user->ident,user->host,irc::Spacify(OperType),parameters[0].c_str()); - user->WriteNumeric(381, "%s :You are now %s %s",user->nick, strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType)); + ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')",user->nick.c_str(),user->ident.c_str(),user->host,irc::Spacify(OperType),parameters[0].c_str()); + user->WriteNumeric(381, "%s :You are now %s %s",user->nick.c_str(), strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType)); if (!user->IsModeSet('o')) user->Oper(OperType, LoginName); } @@ -130,25 +130,25 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User } // tell them they suck, and lag them up to help prevent brute-force attacks - user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick); + user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str()); user->IncreasePenalty(10); - 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].c_str(), 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.c_str(),user->ident.c_str(),user->host, parameters[0].c_str(), fields.c_str()); ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + 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,user->ident,user->host,parameters[0].c_str(),fields.c_str()); + 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,parameters[0].c_str(),fields.c_str()); return CMD_FAILURE; } else { - user->WriteNumeric(491, "%s :Your oper block does not have a valid opertype associated with it",user->nick); + user->WriteNumeric(491, "%s :Your oper block does not have a valid opertype associated with it",user->nick.c_str()); snprintf(broadcast, MAXBUF, "CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0].c_str(),OperType); ServerInstance->SNO->WriteToSnoMask('o', std::string(broadcast)); - ServerInstance->Logs->Log("OPER",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].c_str()); + ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick.c_str(),user->ident.c_str(),user->host,parameters[0].c_str()); return CMD_FAILURE; } } -- cgit v1.2.3