X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_pass.cpp;h=587c0582ace7cb06e5317e3c9083fe165e27874b;hb=436fad2bf0fb122470a47a1453fa24b446104a8f;hp=3661807a9d4ae951fd02783603838989915d98e9;hpb=e4acbc95b8b6cd5b28d38a2242c02e8ff4991e4a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index 3661807a9..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** 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 (a->GetPass() == parameters[0]) - { + 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; }