From 70ae4bab6f9f92c7de177ff4471f4ce87b2505c6 Mon Sep 17 00:00:00 2001 From: darthgandalf Date: Thu, 9 Sep 2010 03:30:27 +0000 Subject: [PATCH] Lastseen module doesn't display links to webadmin webpages anymore if webadmin isn't loaded. Patch by BrianC, thanks. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2126 726aef4b-f618-498e-8847-2d620e286838 --- modules/lastseen.cpp | 12 +++++++++++- modules/lastseen/tmpl/index.tmpl | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/lastseen.cpp b/modules/lastseen.cpp index 4307aa40..15182457 100644 --- a/modules/lastseen.cpp +++ b/modules/lastseen.cpp @@ -94,6 +94,16 @@ public: virtual bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) { if (sPageName.empty() || sPageName == "index") { + CModules& GModules = CZNC::Get().GetModules(); + if (GModules.size()) { + for (unsigned int b = 0; b < GModules.size(); b++) { + if(GModules[b]->GetModName().Equals("WEBADMIN")) { + Tmpl["WebAdminLoaded"] = "true"; + break; + } + } + } + MTimeMulti mmSorted; const MUsers& mUsers = CZNC::Get().GetUserMap(); @@ -134,7 +144,7 @@ public: Row["Info"] += " channel" + CString(n == 1 ? "" : "s"); } } - + return true; } diff --git a/modules/lastseen/tmpl/index.tmpl b/modules/lastseen/tmpl/index.tmpl index a4695f6e..ff24254d 100644 --- a/modules/lastseen/tmpl/index.tmpl +++ b/modules/lastseen/tmpl/index.tmpl @@ -7,7 +7,7 @@ User Last Seen Info - Action + Action @@ -16,10 +16,10 @@ - + [Edit] [Delete] - +