- if ((!strcmp(parameters[0],username.c_str())) && (!strcmp(parameters[1],pass.c_str())))
- {
- if (mask != "")
- {
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
- Srv->ChangeHost(user,mask);
- return;
- }
- }
- }
- Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :Invalid username or password.");
- }
+ std::string hash = Conf->ReadValue("vhost","hash",index);
+
+ if ((!strcmp(parameters[0],username.c_str())) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1], hash.c_str()))
+ {
+ if (!mask.empty())
+ {
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Setting your VHost: " + mask);
+ user->ChangeDisplayedHost(mask.c_str());
+ delete Conf;
+ return CMD_LOCALONLY;
+ }
+ }
+ }
+
+ user->WriteServ("NOTICE "+std::string(user->nick)+" :Invalid username or password.");
+ delete Conf;
+ return CMD_FAILURE;
+ }