From 78f7897dfcee5134005479f9cf6f4fd20dcbe8d2 Mon Sep 17 00:00:00 2001 From: Vasily Fomin Date: Thu, 29 May 2014 17:37:25 +0200 Subject: [PATCH] Add "Loaded" flag to the network page. --- modules/data/webadmin/tmpl/add_edit_network.tmpl | 12 ++++++++++++ modules/webadmin.cpp | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/data/webadmin/tmpl/add_edit_network.tmpl b/modules/data/webadmin/tmpl/add_edit_network.tmpl index ece6363a..1e84593f 100644 --- a/modules/data/webadmin/tmpl/add_edit_network.tmpl +++ b/modules/data/webadmin/tmpl/add_edit_network.tmpl @@ -162,6 +162,8 @@ Name Arguments Description + Loaded globally + Loaded by user @@ -181,6 +183,16 @@ + + + + + + + + + + diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp index 96a759d3..0dce9048 100644 --- a/modules/webadmin.cpp +++ b/modules/webadmin.cpp @@ -749,9 +749,15 @@ public: if (pModule) { l["Checked"] = "true"; l["Args"] = pModule->GetArgs(); - } + } } + // Check if module is loaded globally + l["LoadedGlobally"] = CString(CZNC::Get().GetModules().FindModule(Info.GetName()) != NULL); + + // Check if module is loaded by user + l["LoadedByUser"] = CString(pUser->GetModules().FindModule(Info.GetName()) != NULL); + if (!spSession->IsAdmin() && pUser->DenyLoadMod()) { l["Disabled"] = "true"; }