summaryrefslogtreecommitdiff
path: root/src/modules/m_sqloper.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:44 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:45:44 +0000
commita30abe26fc803900eaf5dc4c08a31aa1d3c9c89f (patch)
tree7d59c15a9c23401b91e100ebb9e98df2c7179e53 /src/modules/m_sqloper.cpp
parentff3eef491aa9e107d09d9dd9560ef7715b37b3b3 (diff)
Change User::oper to an OperInfo reference
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11945 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sqloper.cpp')
-rw-r--r--src/modules/m_sqloper.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/modules/m_sqloper.cpp b/src/modules/m_sqloper.cpp
index c4eaa6911..a6da1ddaa 100644
--- a/src/modules/m_sqloper.cpp
+++ b/src/modules/m_sqloper.cpp
@@ -275,26 +275,21 @@ public:
bool OperUser(User* user, const std::string &pattern, const std::string &type)
{
- ConfigReader Conf;
-
- for (int j = 0; j < Conf.Enumerate("type"); j++)
- {
- std::string tname = Conf.ReadValue("type","name",j);
- std::string hostname(user->ident);
+ OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + type);
+ if (iter == ServerInstance->Config->oper_blocks.end())
+ return false;
+ OperInfo* ifo = iter->second;
- hostname.append("@").append(user->host);
+ std::string hostname(user->ident);
- if ((tname == type) && OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
- {
- /* Opertype and host match, looks like this is it. */
- std::string operhost = Conf.ReadValue("type", "host", j);
+ hostname.append("@").append(user->host);
- if (operhost.size())
- user->ChangeDisplayedHost(operhost.c_str());
+ if (OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
+ {
+ /* Opertype and host match, looks like this is it. */
- user->Oper(type, tname);
- return true;
- }
+ user->Oper(ifo);
+ return true;
}
return false;