+
+ static void RecheckClass(LocalUser* user)
+ {
+ user->MyClass = NULL;
+ user->SetClass();
+ user->CheckClass();
+ }
+
+ static void ChangeIP(LocalUser* user, const std::string& newip)
+ {
+ ServerInstance->Users->RemoveCloneCounts(user);
+ user->SetClientIP(newip.c_str());
+ ServerInstance->Users->AddLocalClone(user);
+ ServerInstance->Users->AddGlobalClone(user);
+ }
+
+ void HandleIdentOrPass(LocalUser* user, const std::string& newip, bool was_pass)
+ {
+ cmd.realhost.set(user, user->host);
+ cmd.realip.set(user, user->GetIPString());
+ ChangeIP(user, newip);
+ user->host = user->dhost = user->GetIPString();
+ user->InvalidateCache();
+ RecheckClass(user);
+ // Don't create the resolver if the core couldn't put the user in a connect class or when dns is disabled
+ if (user->quitting || ServerInstance->Config->NoUserDns)
+ return;
+
+ try
+ {
+ bool cached;
+ CGIResolver* r = new CGIResolver(this, cmd.notify, newip, user, (was_pass ? "PASS" : "IDENT"), cached, waiting);
+ ServerInstance->AddResolver(r, cached);
+ waiting.set(user, waiting.get(user) + 1);
+ }
+ catch (...)
+ {
+ if (cmd.notify)
+ ServerInstance->SNO->WriteToSnoMask('a', "Connecting user %s detected as using CGI:IRC (%s), but I could not resolve their hostname!", user->nick.c_str(), user->host.c_str());
+ }
+ }
+