]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd_stats.cpp
Add UserManager::GetUsers()
[user/henk/code/inspircd.git] / src / modules / m_httpd_stats.cpp
index 346fe41f51cce2a2f011f9ba2665cc78ef1618a0..2dcf1e1cf4be55de4e758255a475bfbafa962126 100644 (file)
@@ -52,7 +52,7 @@ class ModuleHttpStats : public Module
                                ret += it->second;
                                ret += ';';
                        }
-                       else if (*x == 0x9 ||  *x == 0xA || *x == 0xD || *x >= 0x20)
+                       else if (*x == 0x09 ||  *x == 0x0A || *x == 0x0D || ((*x >= 0x20) && (*x <= 0x7e)))
                        {
                                // The XML specification defines the following characters as valid inside an XML document:
                                // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
@@ -104,10 +104,10 @@ class ModuleHttpStats : public Module
                                        << Sanitize(ServerInstance->GetVersionString()) << "</version></server>";
 
                                data << "<general>";
-                               data << "<usercount>" << ServerInstance->Users->clientlist->size() << "</usercount>";
-                               data << "<channelcount>" << ServerInstance->chanlist->size() << "</channelcount>";
+                               data << "<usercount>" << ServerInstance->Users->GetUsers().size() << "</usercount>";
+                               data << "<channelcount>" << ServerInstance->GetChans().size() << "</channelcount>";
                                data << "<opercount>" << ServerInstance->Users->all_opers.size() << "</opercount>";
-                               data << "<socketcount>" << (ServerInstance->SE->GetUsedFds()) << "</socketcount><socketmax>" << ServerInstance->SE->GetMaxFds() << "</socketmax><socketengine>" << ServerInstance->SE->GetName() << "</socketengine>";
+                               data << "<socketcount>" << (SocketEngine::GetUsedFds()) << "</socketcount><socketmax>" << SocketEngine::GetMaxFds() << "</socketmax><socketengine>" INSPIRCD_SOCKETENGINE_NAME "</socketengine>";
 
                                time_t current_time = 0;
                                current_time = ServerInstance->Time();
@@ -150,9 +150,10 @@ class ModuleHttpStats : public Module
                                }
                                data << "</modulelist><channellist>";
 
-                               for (chan_hash::const_iterator a = ServerInstance->chanlist->begin(); a != ServerInstance->chanlist->end(); ++a)
+                               const chan_hash& chans = ServerInstance->GetChans();
+                               for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i)
                                {
-                                       Channel* c = a->second;
+                                       Channel* c = i->second;
 
                                        data << "<channel>";
                                        data << "<usercount>" << c->GetUsers()->size() << "</usercount><channelname>" << Sanitize(c->name) << "</channelname>";
@@ -168,7 +169,7 @@ class ModuleHttpStats : public Module
                                        {
                                                Membership* memb = x->second;
                                                data << "<channelmember><uid>" << memb->user->uuid << "</uid><privs>"
-                                                       << Sanitize(c->GetAllPrefixChars(x->first)) << "</privs><modes>"
+                                                       << Sanitize(memb->GetAllPrefixChars()) << "</privs><modes>"
                                                        << memb->modes << "</modes>";
                                                DumpMeta(data, memb);
                                                data << "</channelmember>";
@@ -181,9 +182,10 @@ class ModuleHttpStats : public Module
 
                                data << "</channellist><userlist>";
 
-                               for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); ++a)
+                               const user_hash& users = ServerInstance->Users->GetUsers();
+                               for (user_hash::const_iterator i = users.begin(); i != users.end(); ++i)
                                {
-                                       User* u = a->second;
+                                       User* u = i->second;
 
                                        data << "<user>";
                                        data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>"