From: brain Date: Mon, 30 Jul 2007 18:53:11 +0000 (+0000) Subject: Output is now xml in trunk. X-Git-Tag: v2.0.23~4845 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=e61cedcdb1563eb6f0159169c0d6f1cb5343c3ff;p=user%2Fhenk%2Fcode%2Finspircd.git Output is now xml in trunk. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7629 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 37bc7615e..70b73e13d 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -87,43 +87,26 @@ class ModuleHttpStats : public Module if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) { - data << "\n\ - "; - - data << ""; - data << ""; - data << "InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")"; - data << ""; - data << "

InspIRCd server statisitics for " << ServerInstance->Config->ServerName << " (" << ServerInstance->Config->ServerDesc << ")

"; - - data << "
"; - data << "

Totals

"; - data << ""; - data << ""; - data << ""; - data << ""; - data << ""; - data << "
Users" << ServerInstance->clientlist->size() << "
Channels" << ServerInstance->chanlist->size() << "
Opers" << ServerInstance->all_opers.size() << "
Sockets" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << " (Max: " << ServerInstance->SE->GetMaxFds() << " via socket engine '" << ServerInstance->SE->GetName() << "')
"; - data << "
"; - - data << "
"; - data << "

Modules

"; - data << ""; + data << ""; + + data << "" << ServerInstance->Config->ServerName << "" << ServerInstance->Config->ServerDesc << ""; + + data << ""; + data << "" << ServerInstance->clientlist->size() << ""; + data << "" << ServerInstance->chanlist->size() << ""; + data << "" << ServerInstance->all_opers.size() << ""; + data << "" << (ServerInstance->SE->GetMaxFds() - ServerInstance->SE->GetRemainingFds()) << "" << ServerInstance->SE->GetMaxFds() << + "" << ServerInstance->SE->GetName() << "')"; + data << ""; + data << ""; for (int i = 0; i <= ServerInstance->GetModuleCount(); i++) { if (!ServerInstance->Config->module_names[i].empty()) - data << ""; + data << "" << ServerInstance->Config->module_names[i] << ""; } - data << "
" << ServerInstance->Config->module_names[i] << "
"; - data << "
"; - - data << "
"; - data << "

Channels

"; - data << ""; - data << ""; + data << ""; + data << ""; /* If the list has changed since last time it was displayed, re-sort it * this time only (not every time, as this would be moronic) */ @@ -136,31 +119,21 @@ class ModuleHttpStats : public Module chanrec* c = ServerInstance->FindChan(a->second.c_str()); if (c && !c->IsModeSet('s') && !c->IsModeSet('p')) { - data << ""; - data << ""; - data << ""; - data << ""; - data << ""; - data << ""; + data << ""; + data << "" << c->GetUsers()->size() << "" << c->name << ""; + data << "" << c->GetOppedUsers()->size() << ""; + data << "" << c->GetHalfoppedUsers()->size() << ""; + data << "" << c->GetVoicedUsers()->size() << ""; + data << "" << c->topic << ""; + data << ""; } } - data << "
UsersName@%+Topic
" << a->first << "" << c->GetUsers()->size() << "" << c->GetOppedUsers()->size() << "" << c->GetHalfoppedUsers()->size() << "" << c->GetVoicedUsers()->size() << "" << c->topic << "
"; - data << "
"; - - - - - - data << "
"; - data << "

Valid XHTML 1.1

"; - data << "
"; - - data << ""; - data << ""; + data << ""; + data << ""; /* Send the document back to m_httpd */ - HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html; charset=iso-8859-1\r\n"); + HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/xml\r\n"); Request req((char*)&response, (Module*)this, event->GetSource()); req.Send(); }