]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd_acl.cpp
Add extban types +bb R: and M: - stops matching account masks from joining and speaki...
[user/henk/code/inspircd.git] / src / modules / m_httpd_acl.cpp
index e29c50c31535ce819308ac38690bb2e606acba8f..0aa4628180b5a705def7a1796ebe1f8b695d2ece 100644 (file)
@@ -19,7 +19,7 @@
 /* $ModDesc: Provides access control lists (passwording of resources, ip restrictions etc) to m_httpd.so dependent modules */
 /* $ModDep: httpd.h */
 
-class ACL : public Extensible
+class HTTPACL : public Extensible
 {
  public:
        std::string path;
@@ -28,20 +28,20 @@ class ACL : public Extensible
        std::string whitelist;
        std::string blacklist;
 
-       ACL(const std::string &set_path, const std::string &set_username, const std::string &set_password,
+       HTTPACL(const std::string &set_path, const std::string &set_username, const std::string &set_password,
                const std::string &set_whitelist, const std::string &set_blacklist)
                : path(set_path), username(set_username), password(set_password), whitelist(set_whitelist),
                blacklist(set_blacklist) { }
 
-       ~ACL() { }
+       ~HTTPACL() { }
 };
 
 class ModuleHTTPAccessList : public Module
 {
-       
+
        std::string stylesheet;
        bool changed;
-       std::vector<ACL> acl_list;
+       std::vector<HTTPACL> acl_list;
 
  public:
 
@@ -85,7 +85,7 @@ class ModuleHTTPAccessList : public Module
                        ServerInstance->Logs->Log("m_httpd_acl", DEBUG, "Read ACL: path=%s pass=%s whitelist=%s blacklist=%s", path.c_str(),
                                        password.c_str(), whitelist.c_str(), blacklist.c_str());
 
-                       acl_list.push_back(ACL(path, username, password, whitelist, blacklist));
+                       acl_list.push_back(HTTPACL(path, username, password, whitelist, blacklist));
                }
        }
 
@@ -171,7 +171,7 @@ class ModuleHTTPAccessList : public Module
                        ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd acl event");
                        HTTPRequest* http = (HTTPRequest*)event->GetData();
 
-                       for (std::vector<ACL>::const_iterator this_acl = acl_list.begin(); this_acl != acl_list.end(); ++this_acl)
+                       for (std::vector<HTTPACL>::const_iterator this_acl = acl_list.begin(); this_acl != acl_list.end(); ++this_acl)
                        {
                                if (match(http->GetURI(), this_acl->path))
                                {
@@ -207,8 +207,8 @@ class ModuleHTTPAccessList : public Module
 
                                                if (!allow_access)
                                                {
-                                                       ServerInstance->Logs->Log("m_httpd_acl", DEBUG, "Denying access to whitelisted resource %s (matched by pattern %s) from ip %s (matched by entry %s)",
-                                                                       http->GetURI().c_str(), this_acl->path.c_str(), http->GetIP().c_str(), entry.c_str());
+                                                       ServerInstance->Logs->Log("m_httpd_acl", DEBUG, "Denying access to whitelisted resource %s (matched by pattern %s) from ip %s (Not in whitelist)",
+                                                                       http->GetURI().c_str(), this_acl->path.c_str(), http->GetIP().c_str());
                                                        BlockAccess(http, event, 403);
                                                        return;
                                                }
@@ -226,7 +226,7 @@ class ModuleHTTPAccessList : public Module
                                                        irc::spacesepstream sep(authorization);
                                                        std::string authtype;
                                                        std::string base64;
-                                                       
+
                                                        sep.GetToken(authtype);
                                                        if (authtype == "Basic")
                                                        {