diff options
| author | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-04-11 00:08:28 -0500 |
| commit | 4f9b7874d6b3a41939ecc2e872ec08d03af7b5f1 (patch) | |
| tree | 43162205d31b277c9ff12ee28b7e3a60d6382316 /modules/extra/m_ldap.cpp | |
| parent | 207c46c871e85b55ae66acc456c6bc412c0c79f9 (diff) | |
Pass new config and the new config reader to the OnReload event, aswell as call it on module load on modules that hook to it
Diffstat (limited to 'modules/extra/m_ldap.cpp')
| -rw-r--r-- | modules/extra/m_ldap.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 80a6b5a9e..3200d3e38 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -409,8 +409,6 @@ class ModuleLDAP : public Module, public Pipe Implementation i[] = { I_OnReload, I_OnModuleUnload }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - - OnReload(); } ~ModuleLDAP() @@ -425,9 +423,8 @@ class ModuleLDAP : public Module, public Pipe LDAPServices.clear(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; int i, num; for (std::map<Anope::string, LDAPService *>::iterator it = this->LDAPServices.begin(); it != this->LDAPServices.end();) @@ -436,9 +433,9 @@ class ModuleLDAP : public Module, public Pipe LDAPService *s = it->second; ++it; - for (i = 0, num = config.Enumerate("ldap"); i < num; ++i) + for (i = 0, num = reader.Enumerate("ldap"); i < num; ++i) { - if (config.ReadValue("ldap", "name", "main", i) == cname) + if (reader.ReadValue("ldap", "name", "main", i) == cname) { break; } @@ -454,16 +451,16 @@ class ModuleLDAP : public Module, public Pipe } } - for (i = 0, num = config.Enumerate("ldap"); i < num; ++i) + for (i = 0, num = reader.Enumerate("ldap"); i < num; ++i) { - Anope::string connname = config.ReadValue("ldap", "name", "main", i); + Anope::string connname = reader.ReadValue("ldap", "name", "main", i); if (this->LDAPServices.find(connname) == this->LDAPServices.end()) { - Anope::string server = config.ReadValue("ldap", "server", "127.0.0.1", i); - int port = config.ReadInteger("ldap", "port", "389", i, true); - Anope::string admin_binddn = config.ReadValue("ldap", "admin_binddn", "", i); - Anope::string admin_password = config.ReadValue("ldap", "admin_password", "", i); + Anope::string server = reader.ReadValue("ldap", "server", "127.0.0.1", i); + int port = reader.ReadInteger("ldap", "port", "389", i, true); + Anope::string admin_binddn = reader.ReadValue("ldap", "admin_binddn", "", i); + Anope::string admin_password = reader.ReadValue("ldap", "admin_password", "", i); try { |
