mirror of
https://github.com/znc/znc.git
synced 2026-05-10 07:14:43 +02:00
Add missing DenyLoadMod check in admin.cpp, following
up revision 1845. Patch by Nirjen, thanks again! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1864 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -601,6 +601,11 @@ class CAdminMod : public CModule {
|
||||
if (!pUser)
|
||||
return;
|
||||
|
||||
if (pUser->DenyLoadMod() && !m_pUser->IsAdmin()) {
|
||||
PutModule("Loading modules has been denied");
|
||||
return;
|
||||
}
|
||||
|
||||
CModule *pMod = (pUser)->GetModules().FindModule(sModName);
|
||||
if (!pMod) {
|
||||
if (!(pUser)->GetModules().LoadModule(sModName, sArgs, pUser, sModRet, false)) {
|
||||
@@ -633,6 +638,11 @@ class CAdminMod : public CModule {
|
||||
CUser* pUser = GetUser(sUsername);
|
||||
if (!pUser)
|
||||
return;
|
||||
|
||||
if (pUser->DenyLoadMod() && !m_pUser->IsAdmin()) {
|
||||
PutModule("Loading modules has been denied");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(pUser)->GetModules().UnloadModule(sModName, sModRet)) {
|
||||
PutModule("Unable to unload module [" + sModName + "] [" + sModRet + "]");
|
||||
|
||||
Reference in New Issue
Block a user