X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_pass.cpp;h=29c83c3bf9c7fce8dc84450e5fdd5e69860cec8e;hb=d49e33b22c2cbb22bad71fb07ce8003dec8270cf;hp=60930c5b5f15598f167a7ecafcaf64f44b5fb8f9;hpb=1552f3918ac0dad7fef9b86b70c0f4a63d4e37a7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_pass.cpp b/src/cmd_pass.cpp index 60930c5b5..29c83c3bf 100644 --- a/src/cmd_pass.cpp +++ b/src/cmd_pass.cpp @@ -11,12 +11,11 @@ * --------------------------------------------------- */ +#include "inspircd.h" #include "users.h" #include "commands/cmd_pass.h" - - -extern "C" command_t* init_command(InspIRCd* Instance) +extern "C" DllExport command_t* init_command(InspIRCd* Instance) { return new cmd_pass(Instance); } @@ -29,9 +28,12 @@ CmdResult cmd_pass::Handle (const char** parameters, int pcnt, userrec *user) user->WriteServ("462 %s :You may not reregister",user->nick); return CMD_FAILURE; } - ConnectClass a = user->GetClass(); + ConnectClass* a = user->GetClass(); + if (!a) + return CMD_FAILURE; + strlcpy(user->password,parameters[0],63); - if (!strcmp(parameters[0],a.pass.c_str())) + if (a->GetPass() == parameters[0]) { user->haspassed = true; }