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_authentication.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_authentication.cpp')
-rw-r--r-- | modules/extra/m_ldap_authentication.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp index cc5626cd3..f39bb43e8 100644 --- a/modules/extra/m_ldap_authentication.cpp +++ b/modules/extra/m_ldap_authentication.cpp @@ -224,22 +224,19 @@ class NSIdentifyLDAP : public Module Implementation i[] = { I_OnReload, I_OnPreCommand, I_OnCheckAuthentication, I_OnNickIdentify, I_OnNickRegister }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); ModuleManager::SetPriority(this, PRIORITY_FIRST); - - OnReload(); } - void OnReload() anope_override + void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override { - ConfigReader config; - - basedn = config.ReadValue("m_ldap_authentication", "basedn", "", 0); - search_filter = config.ReadValue("m_ldap_authentication", "search_filter", "", 0); - object_class = config.ReadValue("m_ldap_authentication", "object_class", "", 0); - username_attribute = config.ReadValue("m_ldap_authentication", "username_attribute", "", 0); - this->password_attribute = config.ReadValue("m_ldap_authentication", "password_attribute", "", 0); - email_attribute = config.ReadValue("m_ldap_authentication", "email_attribute", "", 0); - this->disable_register_reason = config.ReadValue("m_ldap_authentication", "disable_register_reason", "", 0); - this->disable_email_reason = config.ReadValue("m_ldap_authentication", "disable_email_reason", "", 0); + + basedn = reader.ReadValue("m_ldap_authentication", "basedn", "", 0); + search_filter = reader.ReadValue("m_ldap_authentication", "search_filter", "", 0); + object_class = reader.ReadValue("m_ldap_authentication", "object_class", "", 0); + username_attribute = reader.ReadValue("m_ldap_authentication", "username_attribute", "", 0); + this->password_attribute = reader.ReadValue("m_ldap_authentication", "password_attribute", "", 0); + email_attribute = reader.ReadValue("m_ldap_authentication", "email_attribute", "", 0); + this->disable_register_reason = reader.ReadValue("m_ldap_authentication", "disable_register_reason", "", 0); + this->disable_email_reason = reader.ReadValue("m_ldap_authentication", "disable_email_reason", "", 0); if (!email_attribute.empty()) /* Don't complain to users about how they need to update their email, we will do it for them */ |