]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd_acl.cpp
m_callerid Route ACCEPT to the server of the target user only, do not send METADATA...
[user/henk/code/inspircd.git] / src / modules / m_httpd_acl.cpp
index 70c36a1545f593261cc2ecd2411a1af6071c7097..676b35ca4ec1ab7d029ea306608e5dd89c0f8ad7 100644 (file)
@@ -19,7 +19,7 @@
 
 
 #include "inspircd.h"
-#include "httpd.h"
+#include "modules/httpd.h"
 #include "protocol.h"
 
 /* $ModDesc: Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules */
@@ -43,9 +43,15 @@ class ModuleHTTPAccessList : public Module
 {
        std::string stylesheet;
        std::vector<HTTPACL> acl_list;
+       HTTPdAPI API;
 
  public:
-       void ReadConfig()
+       ModuleHTTPAccessList()
+               : API(this)
+       {
+       }
+
+       void OnRehash(User* user)
        {
                acl_list.clear();
                ConfigTagList acls = ServerInstance->Config->ConfTags("httpdacl");
@@ -89,10 +95,10 @@ class ModuleHTTPAccessList : public Module
                }
        }
 
-       void init()
+       void init() CXX11_OVERRIDE
        {
-               ReadConfig();
-               Implementation eventlist[] = { I_OnEvent };
+               OnRehash(NULL);
+               Implementation eventlist[] = { I_OnEvent, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
@@ -105,14 +111,14 @@ class ModuleHTTPAccessList : public Module
                response.headers.SetHeader("X-Powered-By", "m_httpd_acl.so");
                if (!extraheaderkey.empty())
                        response.headers.SetHeader(extraheaderkey, extraheaderval);
-               response.Send();
+               API->SendResponse(response);
        }
 
-       void OnEvent(Event& event)
+       void OnEvent(Event& event) CXX11_OVERRIDE
        {
                if (event.id == "httpd_acl")
                {
-                       ServerInstance->Logs->Log("m_http_stats", LOG_DEBUG,"Handling httpd acl event");
+                       ServerInstance->Logs->Log("m_http_stats", LOG_DEBUG, "Handling httpd acl event");
                        HTTPRequest* http = (HTTPRequest*)&event;
 
                        for (std::vector<HTTPACL>::const_iterator this_acl = acl_list.begin(); this_acl != acl_list.end(); ++this_acl)
@@ -218,7 +224,7 @@ class ModuleHTTPAccessList : public Module
                }
        }
 
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules", VF_VENDOR);
        }