]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ldapoper.cpp
Use !empty() instead of 'size() > 0' when checking parameter count.
[user/henk/code/inspircd.git] / src / modules / m_ldapoper.cpp
index 9bfa3971f225225ecdf1e73048cb11fcd3b8a585..45e83333afd890e09ab05a96d7de0d4d49f2e44e 100644 (file)
@@ -41,7 +41,7 @@ class LDAPOperBase : public LDAPInterface
                if (!user)
                        return;
 
-               Command* oper_command = ServerInstance->Parser->GetHandler("OPER");
+               Command* oper_command = ServerInstance->Parser.GetHandler("OPER");
                if (!oper_command)
                        return;
 
@@ -83,7 +83,7 @@ class BindInterface : public LDAPOperBase
        void OnResult(const LDAPResult& r) CXX11_OVERRIDE
        {
                User* user = ServerInstance->FindUUID(uid);
-               OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(opername);
+               ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->oper_blocks.find(opername);
 
                if (!user || iter == ServerInstance->Config->oper_blocks.end())
                {
@@ -208,7 +208,7 @@ class ModuleLDAPAuth : public Module
                        const std::string& opername = parameters[0];
                        const std::string& password = parameters[1];
 
-                       OperIndex::iterator it = ServerInstance->Config->oper_blocks.find(opername);
+                       ServerConfig::OperIndex::const_iterator it = ServerInstance->Config->oper_blocks.find(opername);
                        if (it == ServerInstance->Config->oper_blocks.end())
                                return MOD_RES_PASSTHRU;
 
@@ -217,7 +217,7 @@ class ModuleLDAPAuth : public Module
                                return MOD_RES_PASSTHRU;
 
                        std::string acceptedhosts = tag->getString("host");
-                       std::string hostname = user->ident + "@" + user->host;
+                       std::string hostname = user->ident + "@" + user->GetRealHost();
                        if (!InspIRCd::MatchMask(acceptedhosts, hostname, user->GetIPString()))
                                return MOD_RES_PASSTHRU;