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:
cflakes
2010-03-31 21:41:30 +00:00
parent 8b865f7c82
commit 9d82e9b920
+10
View File
@@ -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 + "]");