From 664029871afccb19acca2dbf4a33485e6f2b537c Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 1 Feb 2010 01:28:35 +0000 Subject: [PATCH] Add stats O, oper type/permission list git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12342 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/stats.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/stats.cpp b/src/stats.cpp index 9d1970b3b..ef708251f 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -268,6 +268,30 @@ void InspIRCd::DoStats(char statschar, User* user, string_list &results) } } break; + case 'O': + { + for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++) + { + // just the types, not the actual oper blocks... + if (i->first[0] != ' ') + continue; + OperInfo* tag = i->second; + tag->init(); + 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() && tag->AllowedUserModes[c]) + umodes.push_back(c); + mh = ServerInstance->Modes->FindMode(c, MODETYPE_CHANNEL); + if (mh && mh->NeedsOper() && tag->AllowedChanModes[c]) + cmodes.push_back(c); + } + results.push_back(sn+" 243 "+user->nick+" O"+tag->name + " " + umodes + " " + cmodes); + } + } + break; /* stats l (show user I/O stats) */ case 'l': -- 2.39.5