summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-19 14:28:51 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-19 14:28:51 +0200
commite5ada400b0f2e2ae02f40867450a6789126da6e3 (patch)
tree2bb90da3198a359c4c0ea95bf3bfc8731808f7a4 /src/modules
parentbc8664c5c49f4ac9adbc5e3937a584e4a6b35614 (diff)
Access local user list via new UserManager::GetLocalUsers() and make local_users private
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_geoip.cpp7
-rw-r--r--src/modules/m_close.cpp3
-rw-r--r--src/modules/m_jumpserver.cpp3
-rw-r--r--src/modules/m_modenotice.cpp3
-rw-r--r--src/modules/m_nationalchars.cpp3
-rw-r--r--src/modules/m_spanningtree/main.cpp4
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp2
7 files changed, 16 insertions, 9 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp
index f8e358bf7..3561d1a5d 100644
--- a/src/modules/extra/m_geoip.cpp
+++ b/src/modules/extra/m_geoip.cpp
@@ -56,7 +56,8 @@ class ModuleGeoIP : public Module
if (gi == NULL)
throw ModuleException("Unable to initialize geoip, are you missing GeoIP.dat?");
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* user = *i;
if ((user->registered == REG_ALL) && (!ext.get(user)))
@@ -101,7 +102,9 @@ class ModuleGeoIP : public Module
unsigned int unknown = 0;
std::map<std::string, unsigned int> results;
- for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
std::string* cc = ext.get(*i);
if (cc)
diff --git a/src/modules/m_close.cpp b/src/modules/m_close.cpp
index f8bac669d..f3c751f17 100644
--- a/src/modules/m_close.cpp
+++ b/src/modules/m_close.cpp
@@ -35,7 +35,8 @@ class CommandClose : public Command
{
std::map<std::string,int> closed;
- for (UserManager::LocalList::const_iterator u = ServerInstance->Users->local_users.begin(); u != ServerInstance->Users->local_users.end(); ++u)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator u = list.begin(); u != list.end(); ++u)
{
LocalUser* user = *u;
if (user->registered != REG_ALL)
diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp
index 9ee224704..599144448 100644
--- a/src/modules/m_jumpserver.cpp
+++ b/src/modules/m_jumpserver.cpp
@@ -108,7 +108,8 @@ class CommandJumpserver : public Command
if (redirect_all_immediately)
{
/* Redirect everyone but the oper sending the command */
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* t = *i;
if (!t->IsOper())
diff --git a/src/modules/m_modenotice.cpp b/src/modules/m_modenotice.cpp
index 0078c6325..056eb4a62 100644
--- a/src/modules/m_modenotice.cpp
+++ b/src/modules/m_modenotice.cpp
@@ -32,7 +32,8 @@ class CommandModeNotice : public Command
{
std::string msg = "*** From " + src->nick + ": " + parameters[1];
int mlen = parameters[0].length();
- for (UserManager::LocalList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
{
User* user = *i;
for (int n = 0; n < mlen; n++)
diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp
index 3efd97a24..0650cb3d0 100644
--- a/src/modules/m_nationalchars.cpp
+++ b/src/modules/m_nationalchars.cpp
@@ -261,7 +261,8 @@ class ModuleNationalChars : public Module
if (!forcequit)
return;
- for (UserManager::LocalList::const_iterator iter = ServerInstance->Users->local_users.begin(); iter != ServerInstance->Users->local_users.end(); ++iter)
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
+ for (UserManager::LocalList::const_iterator iter = list.begin(); iter != list.end(); ++iter)
{
/* Fix by Brain: Dont quit UID users */
User* n = *iter;
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index b24d8c6ee..8a1aed08f 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -62,7 +62,7 @@ namespace
// Does not change the server of quitting users because those are not in the list
ServerInstance->FakeClient->server = newserver;
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::const_iterator i = list.begin(); i != list.end(); ++i)
(*i)->server = newserver;
}
@@ -70,7 +70,7 @@ namespace
void ResetMembershipIds()
{
// Set all membership ids to 0
- const UserManager::LocalList& list = ServerInstance->Users->local_users;
+ const UserManager::LocalList& list = ServerInstance->Users.GetLocalUsers();
for (UserManager::LocalList::iterator i = list.begin(); i != list.end(); ++i)
{
LocalUser* user = *i;
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index 589e9b889..74854acc9 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -38,7 +38,7 @@ TreeServer::TreeServer()
, VersionString(ServerInstance->GetVersionString())
, fullversion(ServerInstance->GetVersionString(true))
, Socket(NULL), sid(ServerInstance->Config->GetSID()), ServerUser(ServerInstance->FakeClient)
- , age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(ServerInstance->Users->local_users.size())
+ , age(ServerInstance->Time()), Warned(false), bursting(false), UserCount(ServerInstance->Users.GetLocalUsers().size())
, OperCount(0), rtt(0), StartBurst(0), Hidden(false)
{
AddHashEntry();