aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_check.cpp
diff options
context:
space:
mode:
authorGravatar w00t2006-06-17 11:19:50 +0000
committerGravatar w00t2006-06-17 11:19:50 +0000
commit1d27423b182f696966d8095e4e5e727b7ced3df1 (patch)
treec6bf2f6a99291a7fe2c613fdeb7c5137b42dfdc1 /src/modules/m_check.cpp
parentFix for IP-based check (diff)
Hopefully we now have hostmask matching on both vhost and host.
git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@4022 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_check.cpp')
-rw-r--r--src/modules/m_check.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 0466f8f50..3ab31ebbc 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -27,6 +27,7 @@ using namespace std;
/* $ModDesc: Provides the /check command to retrieve information on a user, channel, or IP address */
extern user_hash clientlist;
+extern bool match(const char *, const char *);
static Server *Srv;
@@ -162,6 +163,14 @@ class cmd_check : public command_t
if (inet_aton(parameters[0], &addr.sin_addr) == 0)
{
/* hostname or other */
+ for (user_hash::const_iterator a = clientlist.begin(); a != clientlist.end(); a++)
+ {
+ if (match(a->second->host, parameters[0]) || match(a->second->dhost, parameters[0]))
+ {
+ /* host or vhost matches mask */
+ Srv->SendTo(NULL, user, checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost());
+ }
+ }
}
else
{