1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 /* $ModDesc: Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules */
19 /* $ModDep: httpd.h */
21 class ModuleHTTPAccessList : public Module
24 std::string stylesheet;
31 ConfigReader c(ServerInstance);
34 ModuleHTTPAccessList(InspIRCd* Me) : Module(Me)
38 Implementation eventlist[] = { I_OnEvent, I_OnRequest };
39 ServerInstance->Modules->Attach(eventlist, this, 2);
42 void OnEvent(Event* event)
44 std::stringstream data("");
46 if (event->GetEventID() == "httpd_url")
48 ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd event");
49 HTTPRequest* http = (HTTPRequest*)event->GetData();
53 //if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/"))
55 /* Send the document back to m_httpd */
56 // HTTPDocument response(http->sock, &data, 200);
57 // response.headers.SetHeader("X-Powered-By", "m_httpd_stats.so");
58 // response.headers.SetHeader("Content-Type", "text/xml");
59 // Request req((char*)&response, (Module*)this, event->GetSource());
65 const char* OnRequest(Request* request)
70 virtual ~ModuleHTTPAccessList()
74 virtual Version GetVersion()
76 return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION);
80 MODULE_INIT(ModuleHTTPAccessList)