X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_pass.cpp;h=587c0582ace7cb06e5317e3c9083fe165e27874b;hb=436fad2bf0fb122470a47a1453fa24b446104a8f;hp=fc09d2a414b567100aa608e74583b49146db98b2;hpb=dd36852a52e8541306b76c5b88bce8ab9b36654c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index fc09d2a41..587c0582a 100644 --- a/src/commands/cmd_pass.cpp +++ b/src/commands/cmd_pass.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -19,23 +19,21 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) return new CommandPass(Instance); } -CmdResult CommandPass::Handle (const char* const* parameters, int, User *user) +CmdResult CommandPass::Handle (const std::vector& parameters, User *user) { // Check to make sure they havnt registered -- Fix by FCS if (user->registered == REG_ALL) { - user->WriteServ("462 %s :You may not reregister",user->nick); + user->WriteNumeric(ERR_ALREADYREGISTERED, "%s :You may not reregister",user->nick.c_str()); return CMD_FAILURE; } ConnectClass* a = user->GetClass(); if (!a) return CMD_FAILURE; - strlcpy(user->password,parameters[0],63); - if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0], a->GetHash().c_str())) - { + user->password.assign(parameters[0], 0, 63); + if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0].c_str(), a->GetHash().c_str())) user->haspassed = true; - } return CMD_SUCCESS; }