summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-04-11 14:32:39 +0100
committerSadie Powell <sadie@witchery.services>2021-04-11 14:32:39 +0100
commit405396945a7a3f8f120ad71386b039edfcae0657 (patch)
tree14a32101c4913b4cca21bb94419640dbd060a98c /src/modules
parentbfbd0f6cc6297f26c8348aebe9492246110d0eba (diff)
Allow banning WebIRC users by their gateway name.
Closes #1857.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_cgiirc.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 9ad25e6fb..0759854a2 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -332,6 +332,21 @@ class ModuleCgiIRC
ServerInstance->SNO->EnableSnomask('w', "CGIIRC");
}
+ ModResult OnCheckBan(User* user, Channel*, const std::string& mask) CXX11_OVERRIDE
+ {
+ if (mask.length() <= 2 || mask[0] != 'w' || mask[1] != ':')
+ return MOD_RES_PASSTHRU;
+
+ const std::string* gateway = cmdwebirc.gateway.get(user);
+ if (!gateway)
+ return MOD_RES_PASSTHRU;
+
+ if (InspIRCd::Match(*gateway, mask.substr(2)))
+ return MOD_RES_DENY;
+
+ return MOD_RES_PASSTHRU;
+ }
+
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
std::vector<IdentHost> identhosts;
@@ -516,9 +531,6 @@ class ModuleCgiIRC
void OnWhois(Whois::Context& whois) CXX11_OVERRIDE
{
- if (!whois.IsSelfWhois() && !whois.GetSource()->HasPrivPermission("users/auspex"))
- return;
-
// If these fields are not set then the client is not using a gateway.
const std::string* realhost = cmdwebirc.realhost.get(whois.GetTarget());
const std::string* realip = cmdwebirc.realip.get(whois.GetTarget());