From ef06226521d27de88a49a84d8224568fec7624c3 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 6 May 2013 07:40:43 -0400 Subject: Update the rest of modules.example.conf, default inspircd status modes to a sane rank incase they are prefixless, and 50 other things --- modules/extra/m_ldap.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'modules/extra/m_ldap.cpp') diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp index 4168193a3..17ad60213 100644 --- a/modules/extra/m_ldap.cpp +++ b/modules/extra/m_ldap.cpp @@ -423,7 +423,7 @@ class ModuleLDAP : public Module, public Pipe LDAPServices.clear(); } - void OnReload(Configuration::Conf *conf) anope_override + void OnReload(Configuration::Conf *config) anope_override { int i, num; @@ -433,8 +433,9 @@ class ModuleLDAP : public Module, public Pipe LDAPService *s = it->second; ++it; - for (i = 0; i < Config->CountBlock("ldap"); ++i) - if (Config->GetBlock("ldap", i)->Get("name", "ldap/main") == cname) + Configuration::Block *conf = Config->GetModule(this); + for (i = 0; i < conf->CountBlock("ldap"); ++i) + if (conf->GetBlock("ldap", i)->Get("name", "ldap/main") == cname) break; if (i == num) @@ -447,16 +448,19 @@ class ModuleLDAP : public Module, public Pipe } } - for (i = 0; i < Config->CountBlock("ldap"); ++i) + Configuration::Block *conf = config->GetModule(this); + for (i = 0; i < conf->CountBlock("ldap"); ++i) { - const Anope::string &connname = Config->GetBlock("ldap", i)->Get("name", "ldap/main"); + Configuration::Block *ldap = conf->GetBlock("ldap", i); + + const Anope::string &connname = ldap->Get("name", "ldap/main"); if (this->LDAPServices.find(connname) == this->LDAPServices.end()) { - const Anope::string &server = Config->GetBlock("ldap", i)->Get("server", "127.0.0.1"); - int port = Config->GetBlock("ldap", i)->Get("port", "389"); - const Anope::string &admin_binddn = Config->GetBlock("ldap", i)->Get("admin_binddn"); - const Anope::string &admin_password = Config->GetBlock("ldap", i)->Get("admin_password"); + const Anope::string &server = ldap->Get("server", "127.0.0.1"); + int port = ldap->Get("port", "389"); + const Anope::string &admin_binddn = ldap->Get("admin_binddn"); + const Anope::string &admin_password = ldap->Get("admin_password"); try { -- cgit