summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_ldapauth.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 19:55:36 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 19:55:36 +0000
commit6fb9db23fb74c2b172fd628191cc3bcb7b22de55 (patch)
treeefb1fa21e06d566966e9f3a5a735a4ded8a0485d /src/modules/extra/m_ldapauth.cpp
parent056682a6e1746306117a7f3e820e8c4ea37f722a (diff)
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
Diffstat (limited to 'src/modules/extra/m_ldapauth.cpp')
-rw-r--r--src/modules/extra/m_ldapauth.cpp4
1 files changed, 3 insertions, 1 deletions
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)