From 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 01:55:04 -0400 Subject: Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. --- modules/extra/m_ldap_oper.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/extra/m_ldap_oper.cpp') diff --git a/modules/extra/m_ldap_oper.cpp b/modules/extra/m_ldap_oper.cpp index afe3fde48..4324a7bc0 100644 --- a/modules/extra/m_ldap_oper.cpp +++ b/modules/extra/m_ldap_oper.cpp @@ -1,5 +1,5 @@ #include "module.h" -#include "ldap.h" +#include "ldapapi.h" static std::set my_opers; static Anope::string opertype_attribute; @@ -93,13 +93,15 @@ class LDAPOper : public Module ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } - void OnReload(ServerConfig *conf, ConfigReader &reader) anope_override + void OnReload(Configuration::Conf *conf) anope_override { - this->binddn = reader.ReadValue("m_ldap_oper", "binddn", "", 0); - this->password = reader.ReadValue("m_ldap_oper", "password", "", 0); - this->basedn = reader.ReadValue("m_ldap_oper", "basedn", "", 0); - this->filter = reader.ReadValue("m_ldap_oper", "filter", "", 0); - opertype_attribute = reader.ReadValue("m_ldap_oper", "opertype_attribute", "", 0); + Configuration::Block *config = Config->GetModule(this); + + this->binddn = config->Get("binddn"); + this->password = config->Get("password"); + this->basedn = config->Get("basedn"); + this->filter = config->Get("filter"); + opertype_attribute = config->Get("opertype_attribute"); for (std::set::iterator it = my_opers.begin(), it_end = my_opers.end(); it != it_end; ++it) delete *it; -- cgit