Make UpdateModule reload the module for every module type

UpdateModule has been moved to CZNC because it doesn't really fit into
CUser. The new UpdateModule will reload the module for global modules,
user modules and network modules.

Fixes #69
This commit is contained in:
Kyle Fuller
2011-10-19 10:32:04 +00:00
parent 3a7d0150cf
commit 8659d7224a
5 changed files with 98 additions and 40 deletions

View File

@@ -963,17 +963,11 @@ void CClient::UserCommand(CString& sLine) {
return;
}
if (m_pUser->DenyLoadMod() || !m_pUser->IsAdmin()) {
PutStatus("Unable to reload [" + sMod + "] Access Denied.");
return;
}
PutStatus("Reloading [" + sMod + "] on all users...");
if (CUser::UpdateModule(sMod)) {
PutStatus("Reloading [" + sMod + "] everywhere");
if (CZNC::Get().UpdateModule(sMod)) {
PutStatus("Done");
} else {
PutStatus("Done, but there were errors, some users no longer have ["
+ sMod + "] loaded");
PutStatus("Done, but there were errors, [" + sMod + "] could not be loaded everywhere.");
}
} else if ((sCommand.Equals("ADDBINDHOST") || sCommand.Equals("ADDVHOST")) && m_pUser->IsAdmin()) {
CString sHost = sLine.Token(1);
@@ -1476,7 +1470,7 @@ void CClient::HelpUser() {
Table.AddRow();
Table.SetCell("Command", "UpdateMod");
Table.SetCell("Arguments", "<module>");
Table.SetCell("Description", "Reload a module on all users");
Table.SetCell("Description", "Reload a module everywhere");
}
}