- type = tag->getString("type");
- ConfigTag* typeTag = ServerInstance->Config->opertypes[type];
-
- if (typeTag)
- {
- /* found this oper's opertype */
- if (!ServerInstance->IsNick(type.c_str(), ServerInstance->Config->Limits.NickMax))
- {
- user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick.c_str());
- ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",type.c_str());
- ServerInstance->Logs->Log("OPER",DEFAULT,"OPER: Failed oper attempt by %s!%s@%s: credentials valid, but oper type erroneous.", user->nick.c_str(), user->ident.c_str(), user->host.c_str());
- return CMD_FAILURE;
- }
- std::string host = typeTag->getString("host");
- if (!host.empty())
- user->ChangeDisplayedHost(host.c_str());
- std::string opClass = typeTag->getString("class");
- if (!opClass.empty())
- {
- user->SetClass(opClass);
- user->CheckClass();
- }
- found = true;
- }