summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd_acl.cpp
diff options
context:
space:
mode:
authorGravatar brain2008-05-12 19:06:36 +0000
committerGravatar brain2008-05-12 19:06:36 +0000
commitdfdbcc2939dff8311bd38046f6be518021bcede1 (patch)
treee364116c8e8663af1b86d7b5821b8c4653f2a42b /src/modules/m_httpd_acl.cpp
parentPatch ReadFile() not to bork on one line files, and ensure it works ok with w... (diff)
Skeleton ACL module, and hooks for it. This will provide ip restrictions, passwording etc for httpd modules
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9709 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_httpd_acl.cpp')
-rw-r--r--src/modules/m_httpd_acl.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp
new file mode 100644
index 000000000..e16874bb4
--- /dev/null
+++ b/src/modules/m_httpd_acl.cpp
@@ -0,0 +1,80 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "inspircd.h"
+#include "httpd.h"
+#include "protocol.h"
+
+/* $ModDesc: Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules */
+/* $ModDep: httpd.h */
+
+class ModuleHTTPAccessList : public Module
+{
+
+ std::string stylesheet;
+ bool changed;
+
+ public:
+
+ void ReadConfig()
+ {
+ ConfigReader c(ServerInstance);
+ }
+
+ ModuleHTTPAccessList(InspIRCd* Me) : Module(Me)
+ {
+ ReadConfig();
+ this->changed = true;
+ Implementation eventlist[] = { I_OnEvent, I_OnRequest };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
+ }
+
+ void OnEvent(Event* event)
+ {
+ std::stringstream data("");
+
+ if (event->GetEventID() == "httpd_url")
+ {
+ ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd event");
+ HTTPRequest* http = (HTTPRequest*)event->GetData();
+
+
+
+ //if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/"))
+ //{
+ /* Send the document back to m_httpd */
+ // HTTPDocument response(http->sock, &data, 200);
+ // response.headers.SetHeader("X-Powered-By", "m_httpd_stats.so");
+ // response.headers.SetHeader("Content-Type", "text/xml");
+ // Request req((char*)&response, (Module*)this, event->GetSource());
+ // req.Send();
+ //}
+ }
+ }
+
+ const char* OnRequest(Request* request)
+ {
+ return NULL;
+ }
+
+ virtual ~ModuleHTTPAccessList()
+ {
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION);
+ }
+};
+
+MODULE_INIT(ModuleHTTPAccessList)