From 6fb9db23fb74c2b172fd628191cc3bcb7b22de55 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 4 Apr 2008 19:55:36 +0000 Subject: Apply our own version of mminds patch that doesnt have #defines in it git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9334 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ldapauth.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ldapauth.cpp b/src/modules/extra/m_ldapauth.cpp index 7de157601..de9dc3c6c 100644 --- a/src/modules/extra/m_ldapauth.cpp +++ b/src/modules/extra/m_ldapauth.cpp @@ -42,6 +42,7 @@ class ModuleLDAPAuth : public Module std::string password; int searchscope; bool verbose; + bool useusername; LDAP *conn; public: @@ -73,6 +74,7 @@ public: username = Conf.ReadValue("ldapauth", "binddn", 0); password = Conf.ReadValue("ldapauth", "bindauth", 0); verbose = Conf.ReadFlag("ldapauth", "verbose", 0); /* Set to true if failed connects should be reported to operators */ + useusername = Conf.ReadFlag("ldapauth", "userfield", 0); if (scope == "base") searchscope = LDAP_SCOPE_BASE; @@ -150,7 +152,7 @@ public: free(authpass); LDAPMessage *msg, *entry; - std::string what = (attribute + "=" + user->nick); + std::string what = (attribute + "=" + (useusername ? user->ident : user->nick)); if ((res = ldap_search_ext_s(conn, base.c_str(), searchscope, what.c_str(), NULL, 0, NULL, NULL, NULL, 0, &msg)) != LDAP_SUCCESS) { if (verbose) -- cgit v1.2.3