diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-10 17:18:58 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-10 17:18:58 +0000 |
commit | 52aec3dd2a8a30719b678ea04741c6a36ba82990 (patch) | |
tree | 6a91056bfc6f4c65a7d7b0dce91524ed7b2e3e92 /src/xline.cpp | |
parent | ba5a5b345cdfbc73c0faf9a6cb5fd8d96474ae41 (diff) |
Match IP's with klines, glines and exceptions, as well as hosts
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5201 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r-- | src/xline.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 2fd36bff5..2430283ce 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -381,30 +381,30 @@ char* XLineManager::matches_qline(const char* nick) // returns a pointer to the reason if a host matches a gline, NULL if it didnt match -char* XLineManager::matches_gline(const char* host) +char* XLineManager::matches_gline(userrec* user) { if ((glines.empty()) && (pglines.empty())) return NULL; for (std::vector<GLine>::iterator i = glines.begin(); i != glines.end(); i++) - if (match(host,i->hostmask, true)) + if (match(user->host,i->hostmask, true) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; for (std::vector<GLine>::iterator i = pglines.begin(); i != pglines.end(); i++) - if (match(host,i->hostmask, true)) + if (match(user->host,i->hostmask, true) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; return NULL; } -char* XLineManager::matches_exception(const char* host) +char* XLineManager::matches_exception(userrec* user) { if ((elines.empty()) && (pelines.empty())) return NULL; char host2[MAXBUF]; - snprintf(host2,MAXBUF,"*@%s",host); + snprintf(host2,MAXBUF,"*@%s",user->host); for (std::vector<ELine>::iterator i = elines.begin(); i != elines.end(); i++) - if ((match(host,i->hostmask)) || (match(host2,i->hostmask, true))) + if ((match(user->host,i->hostmask)) || (match(host2,i->hostmask, true)) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; for (std::vector<ELine>::iterator i = pelines.begin(); i != pelines.end(); i++) - if ((match(host,i->hostmask)) || (match(host2,i->hostmask, true))) + if ((match(user->host,i->hostmask)) || (match(host2,i->hostmask, true)) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; return NULL; } @@ -511,15 +511,15 @@ char* XLineManager::matches_zline(const char* ipaddr) // returns a pointer to the reason if a host matches a kline, NULL if it didnt match -char* XLineManager::matches_kline(const char* host) +char* XLineManager::matches_kline(userrec* user) { if ((klines.empty()) && (pklines.empty())) return NULL; for (std::vector<KLine>::iterator i = klines.begin(); i != klines.end(); i++) - if (match(host,i->hostmask, true)) + if ((match(user->host,i->hostmask, true)) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; for (std::vector<KLine>::iterator i = pklines.begin(); i != pklines.end(); i++) - if (match(host,i->hostmask, true)) + if ((match(user->host,i->hostmask, true)) || (match(user->GetIPString(),i->hostmask, true))) return i->reason; return NULL; } @@ -617,12 +617,12 @@ void XLineManager::apply_lines(const int What) if (elines.size() || pelines.size()) { // ignore people matching exempts - if (matches_exception(host)) + if (matches_exception(u)) continue; } if ((What & APPLY_GLINES) && (glines.size() || pglines.size())) { - if ((check = matches_gline(host))) + if ((check = matches_gline(u))) { snprintf(reason,MAXBUF,"G-Lined: %s",check); Goners->AddItem(u,reason); @@ -630,7 +630,7 @@ void XLineManager::apply_lines(const int What) } if ((What & APPLY_KLINES) && (klines.size() || pklines.size())) { - if ((check = matches_kline(host))) + if ((check = matches_kline(u))) { snprintf(reason,MAXBUF,"K-Lined: %s",check); Goners->AddItem(u,reason); |