diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-01 01:28:35 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-01 01:28:35 +0000 |
commit | 664029871afccb19acca2dbf4a33485e6f2b537c (patch) | |
tree | 04d979f80836ec432d6ed0a9577b899210ec69ba | |
parent | 53b99c7324b5868e1660feca4dd81988bd43d371 (diff) |
Add stats O, oper type/permission list
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12342 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/stats.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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': |