+ context.Write("opertype", oper->name);
+ if (loctarg)
+ {
+ std::string umodes;
+ std::string cmodes;
+ for(char c='A'; c <= 'z'; c++)
+ {
+ ModeHandler* mh = ServerInstance->Modes->FindMode(c, MODETYPE_USER);
+ if (mh && mh->NeedsOper() && loctarg->HasModePermission(mh))
+ umodes.push_back(c);
+ mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL);
+ if (mh && mh->NeedsOper() && loctarg->HasModePermission(mh))
+ cmodes.push_back(c);
+ }
+ context.Write("modeperms", "user=" + umodes + " channel=" + cmodes);
+
+ CheckContext::List opcmdlist(context, "commandperms");
+ for (OperInfo::PrivSet::const_iterator i = oper->AllowedOperCommands.begin(); i != oper->AllowedOperCommands.end(); ++i)
+ opcmdlist.Add(*i);
+ opcmdlist.Flush();
+ CheckContext::List privlist(context, "permissions");
+ for (OperInfo::PrivSet::const_iterator i = oper->AllowedPrivs.begin(); i != oper->AllowedPrivs.end(); ++i)
+ privlist.Add(*i);
+ privlist.Flush();
+ }
+ }
+
+ if (loctarg)
+ {
+ context.Write("clientaddr", loctarg->client_sa.str());
+ context.Write("serveraddr", loctarg->server_sa.str());
+
+ std::string classname = loctarg->GetClass()->name;
+ if (!classname.empty())
+ context.Write("connectclass", classname);