]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Move typedef OperIndex to ServerConfig::OperIndex
authorAttila Molnar <attilamolnar@hush.com>
Wed, 16 Jul 2014 10:32:47 +0000 (12:32 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 16 Jul 2014 10:32:47 +0000 (12:32 +0200)
include/configreader.h
include/typedefs.h
src/coremods/core_oper/cmd_oper.cpp
src/coremods/core_stats.cpp
src/modules/m_ldapoper.cpp
src/modules/m_spanningtree/opertype.cpp
src/modules/m_sqloper.cpp
src/modules/m_sslinfo.cpp

index 8615388d521c832aa08cf3b129dd844cb738f6d5..f3137ec0a982d1320be1856de07d62fd29e3c0f0 100644 (file)
@@ -231,6 +231,10 @@ class CoreExport ServerConfig
         */
        typedef std::vector<reference<ConnectClass> > ClassVector;
 
+       /** Index of valid oper blocks and types
+        */
+       typedef std::map<std::string, reference<OperInfo> > OperIndex;
+
        /** Get a configuration tag
         * @param tag The name of the tag to get
         */
index 85d86504f032af6d0a8fcd275e6e54da57006cbf..8f9a6488887ac6ac545423d2e22ededaf6ac07f2 100644 (file)
@@ -82,9 +82,6 @@ typedef ConfigDataHash::const_iterator ConfigIter;
 /** Iterator pair, used for tag-name ranges */
 typedef std::pair<ConfigIter,ConfigIter> ConfigTagList;
 
-/** Index of valid oper blocks and types */
-typedef std::map<std::string, reference<OperInfo> > OperIndex;
-
 /** Files read by the configuration */
 typedef std::map<std::string, file_cache> ConfigFileCache;
 
index 8c0d05ce2e4a5311ca6625caaef297306e4ef62b..e4ba69549e6f7a6ffb6adce0da1a754c8c15bd3d 100644 (file)
@@ -37,7 +37,7 @@ CmdResult CommandOper::HandleLocal(const std::vector<std::string>& parameters, L
        const std::string userHost = user->ident + "@" + user->host;
        const std::string userIP = user->ident + "@" + user->GetIPString();
 
-       OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
+       ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
        if (i != ServerInstance->Config->oper_blocks.end())
        {
                OperInfo* ifo = i->second;
index f9cd78ddda59a2249c058a171585c795c7790202..a6df511d9641a18389ffec3f47a018ce196ab1b3 100644 (file)
@@ -317,7 +317,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
                break;
                case 'O':
                {
-                       for (OperIndex::const_iterator i = ServerInstance->Config->OperTypes.begin(); i != ServerInstance->Config->OperTypes.end(); ++i)
+                       for (ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->OperTypes.begin(); i != ServerInstance->Config->OperTypes.end(); ++i)
                        {
                                OperInfo* tag = i->second;
                                tag->init();
index 36238f846e41ef109d1864215dfa989a4326b2bd..9deb9a203790b703dde614651c00312271ff900f 100644 (file)
@@ -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;
 
index 1a9e36f72c3652fccddbee6753f676e271d770b1..16d75296643dfeeefd33a5262253c38f54daf93d 100644 (file)
@@ -35,7 +35,7 @@ CmdResult CommandOpertype::HandleRemote(RemoteUser* u, std::vector<std::string>&
        ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
        u->SetMode(opermh, true);
 
-       OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(opertype);
+       ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(opertype);
        if (iter != ServerInstance->Config->OperTypes.end())
                u->oper = iter->second;
        else
index 3d5551eb0d1fb453195da155a2430d0bfff00e14..d6581682c958b2abc4223d745e37f70a8c45825c 100644 (file)
@@ -78,7 +78,7 @@ class OpMeQuery : public SQLQuery
 
        bool OperUser(User* user, const std::string &pattern, const std::string &type)
        {
-               OperIndex::iterator iter = ServerInstance->Config->OperTypes.find(type);
+               ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(type);
                if (iter == ServerInstance->Config->OperTypes.end())
                {
                        ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "bad type '%s' in returned row for oper %s", type.c_str(), username.c_str());
index 656a9a432e7dd6bad5333c453f83fa82d69d151e..cac09a412f7d816f9e46a225af413fa82a7ae761 100644 (file)
@@ -168,7 +168,7 @@ class ModuleSSLInfo : public Module
        {
                if ((command == "OPER") && (validated))
                {
-                       OperIndex::iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
+                       ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.find(parameters[0]);
                        if (i != ServerInstance->Config->oper_blocks.end())
                        {
                                OperInfo* ifo = i->second;
@@ -208,7 +208,7 @@ class ModuleSSLInfo : public Module
                if (!cert || cert->fingerprint.empty())
                        return;
                // find an auto-oper block for this user
-               for(OperIndex::iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); i++)
+               for (ServerConfig::OperIndex::const_iterator i = ServerInstance->Config->oper_blocks.begin(); i != ServerInstance->Config->oper_blocks.end(); ++i)
                {
                        OperInfo* ifo = i->second;
                        std::string fp = ifo->oper_block->getString("fingerprint");