X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fextra%2Fm_ldapauth.cpp;h=827179f84ebb0c225d39ff262cc1c5baf82968c5;hb=c202dea024542b9c6c6b771bb9a3a081d9eacdc5;hp=ebfefd02be16eb445d85df7c1b4b757cf458e1e2;hpb=047e29179766076146e7bd6126a883f4f3c95150;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index ebfefd02b..827179f84 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -35,7 +35,6 @@ # pragma comment(lib, "lber.lib") #endif -/* $ModDesc: Allow/Deny connections based upon answer from LDAP server */ /* $LinkerFlags: -lldap */ struct RAIILDAPString @@ -123,9 +122,6 @@ public: { ServerInstance->Modules->AddService(ldapAuthed); ServerInstance->Modules->AddService(ldapVhost); - Implementation eventlist[] = { I_OnCheckReady, I_OnRehash,I_OnUserRegister, I_OnUserConnect }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); - OnRehash(NULL); } ~ModuleLDAPAuth() @@ -134,7 +130,7 @@ public: ldap_unbind_ext(conn, NULL, NULL); } - void OnRehash(User* user) CXX11_OVERRIDE + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("ldapauth"); whitelistedcidrs.clear(); @@ -212,7 +208,7 @@ public: std::string> &replacements) { std::string result; - result.reserve(ServerInstance->Config->Limits.MaxLine); + result.reserve(text.length()); for (unsigned int i = 0; i < text.length(); ++i) { char c = text[i]; @@ -378,7 +374,7 @@ public: attr_value.bv_val = const_cast(val.c_str()); attr_value.bv_len = val.length(); - ServerInstance->Logs->Log("m_ldapauth", LOG_DEBUG, "LDAP compare: %s=%s", attr.c_str(), val.c_str()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "LDAP compare: %s=%s", attr.c_str(), val.c_str()); authed = (ldap_compare_ext_s(conn, DN, attr.c_str(), &attr_value, NULL, NULL) == LDAP_COMPARE_TRUE);