webmods: Fix

One of my recent commits made webmods only find user modules instead of global
modules. This worked before because m_sForcedUser was an empty string which made
the code look for global modules. This commit adds an explicit check for global
modules which hopefully fixes all problems.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2238 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2011-01-01 22:57:54 +00:00
parent 8cadb672f0
commit 0ca689f2eb
+8 -4
View File
@@ -558,11 +558,15 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS
return PrintTemplate("modlist", sPageRet);
}
if (!ForceLogin()) {
return PAGE_DONE;
}
CModule *pModule = CZNC::Get().GetModules().FindModule(m_sModName);
if (!pModule) {
// Check if GetSession()->GetUser() is NULL and display
// an error in that case
if (!ForceLogin())
return PAGE_DONE;
CModule* pModule = CZNC::Get().FindModule(m_sModName, GetSession()->GetUser());
pModule = GetSession()->GetUser()->GetModules().FindModule(m_sModName);
}
if (!pModule) {
return PAGE_NOTFOUND;