]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_pass.cpp
Remove the craqy self-restarting loop in trunk, and use proper safe iterators to...
[user/henk/code/inspircd.git] / src / commands / cmd_pass.cpp
index 3661807a9d4ae951fd02783603838989915d98e9..2333661e77c072cac7cc8d1cc7b37a0ced488329 100644 (file)
@@ -19,12 +19,12 @@ 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 char* const* parameters, int, 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(462, "%s :You may not reregister",user->nick);
                return CMD_FAILURE;
        }
        ConnectClass* a = user->GetClass();
@@ -32,7 +32,7 @@ CmdResult CommandPass::Handle (const char** parameters, int, User *user)
                return CMD_FAILURE;
 
        strlcpy(user->password,parameters[0],63);
-       if (a->GetPass() == parameters[0])
+       if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0], a->GetHash().c_str()))
        {
                user->haspassed = true;
        }