mirror of
https://github.com/znc/znc.git
synced 2026-05-07 22:04:46 +02:00
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:
+8
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user