+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ CustomVhostMap newhosts;
+ ConfigTagList tags = ServerInstance->Config->ConfTags("vhost");
+ for (ConfigIter i = tags.first; i != tags.second; ++i)
+ {
+ ConfigTag* tag = i->second;
+ std::string mask = tag->getString("host");
+ if (mask.empty())
+ throw ModuleException("<vhost:host> is empty! at " + tag->getTagLocation());
+
+ std::string username = tag->getString("user");
+ if (username.empty())
+ throw ModuleException("<vhost:user> is empty! at " + tag->getTagLocation());
+
+ std::string pass = tag->getString("pass");
+ if (pass.empty())
+ throw ModuleException("<vhost:pass> is empty! at " + tag->getTagLocation());
+
+ const std::string hash = tag->getString("hash", "plaintext", 1);
+ if (stdalgo::string::equalsci(hash, "plaintext"))
+ {
+ ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "<vhost> tag for %s at %s contains an plain text password, this is insecure!",
+ username.c_str(), tag->getTagLocation().c_str());
+ }
+
+ CustomVhost vhost(username, pass, hash, mask);
+ newhosts.insert(std::make_pair(username, vhost));
+ }
+
+ cmd.vhosts.swap(newhosts);
+ }
+