]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ldapauth.cpp
Use CommandBase::Params instead of std::vector<std::string>.
[user/henk/code/inspircd.git] / src / modules / m_ldapauth.cpp
index 7da63284a47a430074d1607f4add6728dc633090..fedf02b4dd107f1c7e1c5f694126fc408ee3b12d 100644 (file)
@@ -406,9 +406,22 @@ public:
                        return MOD_RES_DENY;
                }
 
+               std::string what;
+               std::string::size_type pos = user->password.find(':');
+               if (pos != std::string::npos)
+               {
+                       what = attribute + "=" + user->password.substr(0, pos);
+
+                       // Trim the user: prefix, leaving just 'pass' for later password check
+                       user->password = user->password.substr(pos + 1);
+               }
+               else
+               {
+                       what = attribute + "=" + (useusername ? user->ident : user->nick);
+               }
+
                try
                {
-                       std::string what = attribute + "=" + (useusername ? user->ident : user->nick);
                        LDAP->BindAsManager(new AdminBindInterface(this, LDAP.GetProvider(), user->uuid, base, what));
                }
                catch (LDAPException &ex)