From 53f1b8f400549583d4f73c3783eb8612a5ed3d89 Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 16 Sep 2006 03:30:45 +0000 Subject: [PATCH] Patched using globalmods.patch by x-x git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@758 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Client.cpp b/Client.cpp index a452f132..a275501d 100644 --- a/Client.cpp +++ b/Client.cpp @@ -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();