#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 */
{
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");
}
}
- 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));
}
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)
}
}
- 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);
}