- std::string *webirc_hostname, *webirc_ip;
- if(user->GetExt("cgiirc_webirc_hostname", webirc_hostname))
- {
- strlcpy(user->host,webirc_hostname->c_str(),63);
- strlcpy(user->dhost,webirc_hostname->c_str(),63);
- delete webirc_hostname;
- user->InvalidateCache();
- user->Shrink("cgiirc_webirc_hostname");
- }
- if(user->GetExt("cgiirc_webirc_ip", webirc_ip))
- {
- bool valid=false;
- user->RemoveCloneCounts();
-#ifdef IPV6
- valid = (inet_pton(AF_INET6, webirc_ip->c_str(), &((sockaddr_in6*)user->ip)->sin6_addr) > 0);
-
- if(!valid)
- valid = (inet_aton(webirc_ip->c_str(), &((sockaddr_in*)user->ip)->sin_addr));
-#else
- if (inet_aton(webirc_ip->c_str(), &((sockaddr_in*)user->ip)->sin_addr))
- valid = true;
-#endif
-
- delete webirc_ip;
- user->InvalidateCache();
- user->Shrink("cgiirc_webirc_ip");
- ServerInstance->AddLocalClone(user);
- ServerInstance->AddGlobalClone(user);
- user->CheckClass();
- }