Patched using globalmods.patch by x-x

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@758 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-09-16 03:30:45 +00:00
parent ee620347c5
commit 53f1b8f400
+22
View File
@@ -975,6 +975,28 @@ void CClient::UserCommand(const CString& sLine) {
}
} else if ((sCommand.CaseCmp("LISTMODS") == 0) || (sCommand.CaseCmp("LISTMODULES") == 0)) {
#ifdef _MODULES
if (m_pUser->IsAdmin()) {
CModules& GModules = CZNC::Get().GetModules();
if (!GModules.size()) {
PutStatus("No global modules loaded.");
} else {
CTable GTable;
GTable.AddColumn("Name");
GTable.AddColumn("Description");
for (unsigned int b = 0; b < GModules.size(); b++) {
GTable.AddRow();
GTable.SetCell("Name", GModules[b]->GetModName());
GTable.SetCell("Description", GModules[b]->GetDescription().Ellipsize(128));
}
unsigned int uTableIdx = 0; CString sLine;
while (GTable.GetLine(uTableIdx++, sLine)) {
PutStatus(sLine);
}
}
}
if (m_pUser) {
CModules& Modules = m_pUser->GetModules();