summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-16 12:32:47 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-16 12:32:47 +0200
commit7e0e54eba331339606265a8a4e11417bb2f832ba (patch)
tree42853fb81602676e3888c1c8dd95ca85ae34b2e0
parent046da7da9bf57ac9254f76fd1c43eadf1673cdf5 (diff)
Move typedef OperIndex to ServerConfig::OperIndex
-rw-r--r--include/configreader.h4
-rw-r--r--include/typedefs.h3
-rw-r--r--src/coremods/core_oper/cmd_oper.cpp2
-rw-r--r--src/coremods/core_stats.cpp2
-rw-r--r--src/modules/m_ldapoper.cpp4
-rw-r--r--src/modules/m_spanningtree/opertype.cpp2
-rw-r--r--src/modules/m_sqloper.cpp2
-rw-r--r--src/modules/m_sslinfo.cpp4
8 files changed, 12 insertions, 11 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 8615388d5..f3137ec0a 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -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
*/
diff --git a/include/typedefs.h b/include/typedefs.h
index 85d86504f..8f9a64888 100644
--- a/include/typedefs.h
+++ b/include/typedefs.h
@@ -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;
diff --git a/src/coremods/core_oper/cmd_oper.cpp b/src/coremods/core_oper/cmd_oper.cpp
index 8c0d05ce2..e4ba69549 100644
--- a/src/coremods/core_oper/cmd_oper.cpp
+++ b/src/coremods/core_oper/cmd_oper.cpp
@@ -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;
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index f9cd78ddd..a6df511d9 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -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();
diff --git a/src/modules/m_ldapoper.cpp b/src/modules/m_ldapoper.cpp
index 36238f846..9deb9a203 100644
--- a/src/modules/m_ldapoper.cpp
+++ b/src/modules/m_ldapoper.cpp
@@ -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;
diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp
index 1a9e36f72..16d752966 100644
--- a/src/modules/m_spanningtree/opertype.cpp
+++ b/src/modules/m_spanningtree/opertype.cpp
@@ -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
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp
index 3d5551eb0..d6581682c 100644
--- a/src/modules/m_sqloper.cpp
+++ b/src/modules/m_sqloper.cpp
@@ -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());
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index 656a9a432..cac09a412 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -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");